The latest install of rails/webpacker is missing the default webpacker.yml.
when running bin/webpack I get the following error:
Error: Cannot find module '../lib/install/config/webpacker.yml'
Source of error: node_modules/@rails/webpacker/package/config.js
When i copy the defualt webpacker.yml from the repo, compilation works as expected. When I reinstall rails/webpacker this file gets removed again.
I'm sure I'm not the only person seeing this bug as it's blocking my deployment to heroku. I'll note, i was able to deploy last night with no issues and i haven't touched my yarn.lock. I think something may have happened to the npm package.
thanks for posting, i have been hitting the same issue on an application i was trying to update, wondering what i was doing wrong.
Please upgrade to 3.1.1, published a minor version with fix.
yarn upgrade webpacker
bundle update webpacker
still seeing the same issue, let me know how and if I can help, as far as i can see i successfully upgraded to 3.1.1, also tried with āmasterā
[i have another project where i donāt have issues, and i canāt find any relevant difference that could help out]
"dependencies": {
"@rails/webpacker": "^3.1.1ā,
ā¦.
Using webpacker 3.1.1 from https://github.com/rails/webpacker.git (at master@4845441)
Updating files in vendor/cache
Bundle complete! 52 Gemfile dependencies, 157 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
module.js:538
throw err;
^
Error: Cannot find module '../lib/install/config/webpacker.yml'
at Function.Module._resolveFilename (module.js:536:15)
at Function.resolve (internal/module.js:18:19)
at Object.<anonymous> (/Users/koen/Personal/ardis-web/node_modules/@rails/webpacker/package/config.js:6:33)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
Please upgrade to 3.1.1, published a minor version with fix.
yarn upgrade webpacker
bundle update webpackerā
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/rails/webpacker/issues/1082#issuecomment-350977769, or mute the thread https://github.com/notifications/unsubscribe-auth/AArWdh7hXYQ-f765WasHNKBMnkVLnMneks5s_jcBgaJpZM4Q-cd3.
Could you do yarn add @rails/webpacker please? Looks like it's still using old version. You can verify it by going in node_modules/@rails/webpacker and see if /lib/install/config/webpacker.yml is present.
some caching is interfering with the force ā¦
iām trying to find out how and why, but the file is still not appearing /lib/install/config still empty with yarn
[ tried: yarn cache clean ]
[ tried: rm -rf node_modules, yarn install ]
trying : rm -rf nodes_modules, npm install > this is working !!!
so for some reason, when installing with yarn, iām getting some cached version, but when installing with npm iām getting a āfresherā version ā¦
and unfortunately, doing yarn install afterwards again, overwrites again with the āoldā version (no webpacker.yml)
anyone with expertise in yarn and caching behaviour ?
or maybe you need to bump the version to 3.1.2 ?
warm regards
koen
On 12 Dec 2017, at 10:02, Gaurav Tiwari notifications@github.com wrote:
Could you do yarn add @rails/webpacker please? Looks like it's still using old version. You can verify it by going in node_modules/@rails/webpacker and see if /lib/install/config/webpacker.yml is present.
ā
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/rails/webpacker/issues/1082#issuecomment-350987892, or mute the thread https://github.com/notifications/unsubscribe-auth/AArWdpQYXkMSgMPF4VV4pR9Z6-xnu6Zhks5s_kEcgaJpZM4Q-cd3.
Best to check cache directory: https://yarnpkg.com/lang/en/docs/cli/cache/, yarn cache dir and remove the directory itself.
You could also remove yarn.lock to force reinstall (if it's safe)
thanks for the suggestions, version 3.1.1 installed and i can confirm itās working (webpacker.yml present)
Great š
Thanks for your help!
I'm still having trouble with version 3.1.1
I've removed yarn.lock
I've removed the entire cache directory for yarn.
I've removed node_modules/
And I've yarn installed.
No dice.
I'll note that the version in the yarn cache is correct - it has the webpacker.yml, but the copy that is showing up in my node_modules is busted.
Is there another caching layer?
just for info of any other users, after the caching issue first seemed solved, the ābad versionā appeared again also for me.
without actually understanding the actual caching problem - a bit frustrating :) - i than continued clearing all possible caches (also gem caches) and even packing the gemās into the vendor/cache (using bundle package) and somehow after serious cleaning in the wild, in the end, it nows seems to be āstableā and fetching the up to date version.
Thanks for your help!
I'm still having trouble with version 3.1.1
I've removed yarn.lock
I've removed the entire cache directory for yarn.
I've removed node_modules/
And I've yarn installed.No dice.
I'll note that the version in the yarn cache is correct - it has the webpacker.yml, but the copy that is showing up in my node_modules is busted.
Is there another caching layer?
ā
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/rails/webpacker/issues/1082#issuecomment-351263080, or mute the thread https://github.com/notifications/unsubscribe-auth/AArWdszLzDcyKyCdcC04n3Q4gj5Giw7rks5s_zelgaJpZM4Q-cd3.
also had this issue. tried every fix mentioned in thread - no luck.
I finally stumbled on a .yarnclean file in root rails directory. It hadn't been modified in 8 months, perhaps it is legacy yarn stuff? (I have gone through many yarn versions this yearā¦)
among others, it included these lines:
.*.yml
*.yml
I just deleted the file, ran yarn install, and now I have /lib/install/config/webpacker.yml
thanks for the suggestions, version 3.1.1 installed and i can confirm itās working (webpacker.yml present)
Sir version3.1.1 is ruby version?,or rails version? so,please tell me. I ask you.
Most helpful comment
also had this issue. tried every fix mentioned in thread - no luck.
I finally stumbled on a
.yarncleanfile in root rails directory. It hadn't been modified in 8 months, perhaps it is legacy yarn stuff? (I have gone through many yarn versions this yearā¦)among others, it included these lines:
I just deleted the file, ran yarn install, and now I have
/lib/install/config/webpacker.yml