I suspect this issue is Parcel specific, but not certain and could not find any forum for Parcel to post this anyway.
Used elm-app-gen to bootstrap my project.
When I try initializing my app with flags like so:
Elm.Main.init({
node: document.getElementById("app")
, flags: 1
})
And defining them in Main like so:
main : Program Int Model Msg
init : Int -> Url -> Nav.Key -> ( Model, Cmd Msg )
When I try to run the program with parcel public/index.html
the flags are rejected as undefined:
Problem with the flags given to your Elm program on initialization.
Problem with the given value:
undefined
Expecting an INT
If I change my flags value to a String in js though:
Elm.Main.init({
node: document.getElementById("app")
, flags: "test"
})
Then the error does seem to register the value as defined, but incompatible:
Problem with the given value:
"test"
Expecting an INT
If I then change the types in Elm to String as well though:
main : Program String Model Msg
init : String -> Url -> Nav.Key -> ( Model, Cmd Msg )
Then the error goes back to saying the value is undefined…
Problem with the given value:
undefined
Expecting a STRING
Anyone had this issue before or have any idea why it might be doing this?
Any help would be most appreciated!