You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code there assumes that args already exists, and then checks whether there's a node or not.
A solution
I thought to open an issue instead of sending a drive-by PR.
One solution could be just more ternaries, or splitting it out to something named and nicer to debug.
But the root question I suppose is whether "init without arguments means document.body".
I looked through the docs, and that seems to be the case, at least for the current Browser programs.
It seems that package.elm-lang.org also uses init without args, and possibly more user code.
The problem
I have an application where I call init with no arguments. If I leave it like that, then the hmr script throws.
If I add
{}
as the argument, it works.The source
I traced that back to
elm-hot/resources/hmr.js
Line 172 in 3372608
The code there assumes that args already exists, and then checks whether there's a node or not.
A solution
I thought to open an issue instead of sending a drive-by PR.
One solution could be just more ternaries, or splitting it out to something named and nicer to debug.
But the root question I suppose is whether "init without arguments means document.body".
I looked through the docs, and that seems to be the case, at least for the current Browser programs.
It seems that package.elm-lang.org also uses
init
without args, and possibly more user code.view-source:https://package.elm-lang.org/packages/elm/browser/latest/Browser#application
The text was updated successfully, but these errors were encountered: