Updating to 0.17 - Uncaught ReferenceError: Elm is not defined
alanwilhelm opened this issue · comments
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..