elm-community / elm-webpack-starter

Boilerplate for developing Elm apps on Webpack

Home Page:http://elm-community.org/elm-webpack-starter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Updating to 0.17 - Uncaught ReferenceError: Elm is not defined

alanwilhelm opened this issue · comments

commented

Not sure what is causing this. Thoughts? I updated all of the libs and Main.elm file so it compiles with elm-make. It also compiles fine with Webpack but I get this in my browser console.
Uncaught ReferenceError: Elm is not defined

updated package.json:
image

elm-package.json:
image

Hi, I've got same problem - It's mainly due to incompatibility between elm-webpack-loader and elm 0.17. They already fixed this a few hours ago.

So my quick solution:
1. Update elm-webpack-loader in the project root: (ncu = npm-check-updates)

ncu -u && npm update

2. Elm-webpack-loader update breaks elm-hot-loader constraints, so I removed it:

npm uninstall elm-hot-loader --save-dev

3. Edit _webpack.config.js_

test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
//loader: 'elm-hot!elm-webpack'
loader: 'elm-webpack'

4. Edit src / _index.js_

var Elm = require( './Main' );
Elm.Main.embed(document.getElementById( 'main' ));

Thanks guys. Ver 0.17 intro'd quite a few "breaking" changes, per the upgrade doc. I made the updates, to the best of my (poor) Elm abilities. Yes, had to remove elm-hot-loader for the time being. Remember to repeat the install steps..