Hi folks, I encountered a weird issue that the params is sometimes null, I couldn’t find the steps to reproduce, but I have encountered this error many times, but it work again if I restart the server, any ideas to debug?
From me this is a “nope” on how to debug this. The “restart and it is working again” is one of the things that makes mostly “undebuggable”.
Maybe something is “in” your site.Params that breaks the javascript import? Post your params section. If there are any weird things in it that might keep hugo from properly sending things though. Weird apostrophe’s, hyphens, strings that contain literal javascript.
You can’t change site.Params within layouts, so this is definitely not something where the content of a variable is changed.
What do you mean by “sometimes”? You must be doing something and then the params are null. If they are not null on server start, the action might be the culprit.
This is really hard to debug. More info might help.
One more thing: I assume that the browser console does NOT have any error or warning logged. We don’t even know at this point if the NULL is Hugo’s doing or something “normal” in JS.