While updating an in-event generator for the ongoing Generator Manager Event, A Venture Poem Generator, I have tried to add the url-params-plugin
to add a feature so users could disable glows on the poem for performance reasons. But when testing out the generator after saving, it doesn’t work at all. Even when I test if that URL parameter exists at all, it still won’t show the expected output. Whatever parameter I put into the URL, when I run [
, it outputs ]undefined
instead.
I’ve done the same with my view counter experiment generator, and had the same issue. (Try visiting https://perchance.org/the-view-counter-experiment?name=Example, the greeting text above the tabs thing should output Hello, Example!
)
This is more likely a bug with the plugin that for some reason fails to cache those URL parameters into the generator. When I try setting the url
value to [Object.fromEntries([...new URL(window.location.href).searchParams.entries()])]
in place of importing the plugin in that generator, that worked. And since I use two different browsers, both didn’t work with the plugin imported.
Update: After some more testing, the URL params in A Venture Poem Generator now works using the plugin import but not with the view counter experiment one (that link has
?performanceMode=true
inserted for testing). It still greets with the default inputHello, user
without mentioning the inputted name in the URL. It still works inurl-params-plugin-example
though.@perchance@lemmy.world would be nice to take a look at this issue. Is that caused of something with the generators or something else?
Ah looks like it’s a simple mistake of
url = {url-params-plugin}
instead ofurl = {import:url-params-plugin}
:) The former should probably be throwing an informative error though…Yeah thanks for pointing out the issue, I definitely missed that one. I’ve corrected it on the second generator and it worked now.
It is interpreted as a valid, unevaluated string value so that’s probably why it didn’t throw any error. Maybe instead should create a warning for this import mistake so newbies can easily point it out (especially if they noticed something wrong with it) 🙂