-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definition order problem with unboxed types in --optimize #1836
Comments
Just ran into this as well, but with |
I just run into the same error with elm 0.19 and the Here is my minimal test case with a module Main exposing (main)
import Browser
import Browser.Dom
import Browser.Navigation as Nav
import Html exposing (Html)
import Task exposing (attempt)
import Url exposing (Url)
type alias Flags =
{}
type Msg
= NoOp
main : Program Flags () Msg
main =
Browser.application
{ init = init
, onUrlRequest = \_ -> NoOp
, onUrlChange = \_ -> NoOp
, view = \_ -> { title = "", body = [] }
, update = \_ _ -> ( (), Cmd.none )
, subscriptions = \_ -> Sub.none
}
init : Flags -> Url -> Nav.Key -> ( (), Cmd Msg )
init flags url key =
( ()
, Browser.Dom.getElement "id"
|> Task.attempt (always NoOp)
) Related issue: elm/browser#63 |
There is a fix for this, but just to set time expectations, there is quite a bit of work left before a 0.19.1 release is possible. In particular, I found some performance issues caused by laziness that require some larger changes to address reliably. Anyway, thank you for the report! |
Work-around for the following elm compiler bug: elm/compiler#1836 We put the `identity` function at the top the generated js file. This can be removed once next Elm version is released and used.
Work-around for the following elm compiler bug: elm/compiler#1836 We put the `identity` function at the top the generated js file. This can be removed once next Elm version is released and used.
The following SSCCE works fine when compiled without the
--optimize
flag, but causes a runtime exception when compiled with the--optimize
flag.The problematic line in the compiled output is:
which appears above/before the definition of
elm$core$Basics$identity
, which causeselm$browser$Browser$Dom$NotFound
to beundefined
.The text was updated successfully, but these errors were encountered: