Skip to content
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

Hot-reload mode completely blank #272

Open
kwshi opened this issue Aug 30, 2022 · 1 comment
Open

Hot-reload mode completely blank #272

kwshi opened this issue Aug 30, 2022 · 1 comment

Comments

@kwshi
Copy link

kwshi commented Aug 30, 2022

Running a basic elm project created from scratch with elm init and a single src/Main.elm with the following contents:

module Main exposing (..)
import Html
main : Html.Html msg
main = Html.text "hello world"

Expecting to see a page with just the text "hello world". This works correctly when I run elm-live src/Main.elm, but it doesn't work when I run elm-live --hot -- src/Main.elm: instead I get a blank page with nothing showing, and the console shows a myDisposeCallback is not a function error after ~10 seconds or so:
image

Versions: tested on 4.0.0, 4.0.0-rc.1 (@next as of writing), 4.0.1, 4.0.2. Same results all around.

Seems related to #211, (I know @codesections was having the same error message); however, that thread was closed as "fixed" without much/any explanation for how the fix was made. The one suggestion about bumping elm-hot dependency version from 1.1.1 to 1.1.4 does not seem to help-- 4.0.2 already uses [email protected] (by inspecting installed lock file) and still has this issue.

@doubledup
Copy link

The docs say that the --hot flag only works when outputting a js file, so you'll want to pass --output to elm make like elm-live --hot -- --output=main.js src/Main.elm.

You'll also want to set up an HTML file that will load the compiled js. See the --output docs and the js interop section in the guide for an example HTML file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants