-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Elm integration broken #1668
Comments
This is probably blocked until elm-webpack-loader updates elm-community/elm-webpack-loader#142 |
I'm having this issue as well. It looks like elm-webpack-loader was updated earlier today, so hopefully this is no longer blocked. Thanks! |
@dmerand I'd say still broken. I'm stuck with 0.18 unless I'm missing something. |
@ngw Oh it's definitely still broken. I was able to work around it, but it took quite a few manual steps, mostly around new Elm binary commands. Lemme see if I can summarize from memory... https://github.com/rails/webpacker/blob/master/lib/install/elm.rb is where most of the problems lie, starting at line 25: #run "yarn add --dev elm-hot-loader"
run "yarn add --dev elm-hot-webpack-loader"
#run "yarn run elm package install -- --yes"
run "yarn run elm init"
run "yarn run elm make"
say "Updating webpack paths to include .elm file extension"
insert_into_file Webpacker.config.config_path, "- .elm\n".indent(4), after: /extensions:\n/
say "Updating Elm source location"
#gsub_file "elm-package.json", /\"\.\"\n/,
gsub_file "elm-package.json", /\"\src\"\n/,
%("#{Webpacker.config.source_path.relative_path_from(Rails.root)}"\n)
say "Updating .gitignore to include elm-stuff folder"
insert_into_file ".gitignore", "/elm-stuff\n", before: "/node_modules\n"\ ... and then in https://github.com/rails/webpacker/blob/master/lib/install/loaders/elm.js you have to make some mods too: //const elmMake = `${elmSource}/node_modules/.bin/elm-make`
const elmMake = `${elmSource}/node_modules/.bin/elm`
//...
const developmentOptions = Object.assign({}, elmDefaultOptions, {
verbose: true,
//warn: true,
debug: true
})
const elmWebpackLoader = {
//loader: 'elm-webpack-loader',
loader: 'elm-hot-webpack-loader',
options: isProduction ? elmDefaultOptions : developmentOptions
} This got it mostly working for me, except for a slight change I had to make to elm-hot to make live-reloading work. |
Can't you turn this into a PR? |
@ngw I'm not comfortable turning it into a PR because I'm not familiar with this full codebase, nor do I have time to get that familiar. Running the steps above by hand worked for me, but I'm not set up to test my changes against this entire repo. Hopefully what's there will be helpful to a maintainer in creating a more complete PR. |
The command that generates the error does exactly tha same thing as before, the package hasn't been released so there's no way to validate the fix. I manually changed loaders/elm.js because AFAIK that is the only way, still in some kind of dependency hell where different parts of the framework (webpack-dev-server, babel) fail with the most cryptic errors possible. Right now I'm having:
I've deleted tmp/cache and there's no 0.18 on my system ngw@bluemonday ~/directory email_validation ● elm --version |
@ngw that error comes from my Can you try downloading and modifying |
I am still getting the same error as the original poster posted. |
Since the release of Elm 0.19 elm integration on webpacker is broken.
https://gist.github.com/ngw/0bc000fdf484a70dbc9693142790d2f0
Gemfile.lock: https://gist.github.com/ngw/4aa6e1ebb4de91c464554c91665f9625
The text was updated successfully, but these errors were encountered: