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
Rails 6.1.x rails new; rake assets:precompile
is broken
#48372
Comments
Looks like there was a PR opened to fix this in Webpacker, but neither Rails 6 nor Webpacker are receiving bug fixes: rails/webpacker#3315 (comment) |
I know about the support policy, also there’s some amount of discretion at play. This little guy cost me a few hours of my life so at minimum I wanted to open an issue with the error message others might find when they search. I feel like the real issue is that babel should have rev-ed major with that change. We could maybe ask babel to release 7.23.0 with the old name and then rev major to make 8.0 have the change. That would fix the Rails problem (for some subset of users) as I believe webpack is pessimistically locked against the major version. |
I opened babel/babel#15679 to see if they can consider this a bug and rollback the change and move it to 8.x |
I'm ok to release a new webpacker version if it would help. This remind me why we moved away from those workflows |
Thanks! It looks like babel has some suggestions for moving forward. Could you take a look at babel/babel#15679 and let me know if one stands out? |
See rails/rails#48372 as mentioned in the commentary. Also revert commit 0ed27d6 which is a previous unsuccessful workaround.
This bit me today, thanks for creating this issue and providing me with a solution. I wish I had googled sooner. |
It worked for me after changing both the 'proposal' to 'transform' in babel.config.js as seen in simonbaird's commit above. Thank you guys for providing a fix!
|
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
Hi everyone, Good day!
Is somebody familiar with this issue? thanks |
@deathndark it could be because you are using Node >= 17 with Heroku. You can try several approaches, like:
A lot of options are discussed here. |
This worked beautifully for me locally 🎉 |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
Steps to reproduce
Expected behavior
It precompiles fine
Actual behavior
System configuration
Rails version: 6.1.7.3
Ruby version: 3.0.6
Notes
This appears to be happening because webpacker generates a
babel.config.js
https://github.com/rails/webpacker/blob/1cec8408d9c30e458c9f83b0c50ef53a255a4352/lib/install/config/babel.config.js#L57-L60 that includesplugin-proposal-private-methods
, however it does not add a dependency toplugin-proposal-private-methods
. Instead, it depends on a package that depends onplugin-proposal-private-methods
.Recently that package was re-named to
plugin-transform-private-methods
babel/babel#15614 and I believe it was released babel/babel@389ecb0.So now when babel tries to execute it reads in the
babel.config.js
file, sees that it needsplugin-proposal-private-methods
. Tries to load it, but that fails becauseplugin-proposal-private-methods
is not installed (since it is no longer a dependency).A suggested path forward: Update the
babel.config.js
to reference the new file name. Or explicitly depend on all plugins in thebabel.config.js
. Maybe lock down some dependency versions.To anyone hitting this error in your app you can change the name in your
babel.config.js
like this:There are more "proposal" items in there. As this happens again, people will hit the same bug.
The text was updated successfully, but these errors were encountered: