-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Compilation failed on Heroku: ERROR in ./node_modules & unmet peer dependency #2437
Comments
@matthewgoodwin Thank you for posting the extra info, sorry it took so long to get back to you.
It sounds like the classic case of babel mangling the pre-compiled //config/webpack/environment.js
const { environment } = require('@rails/webpacker');
// Bootstrap 4 has a dependency over jQuery & Popper.js:
const webpack = require('webpack');
environment.plugins.prepend('Provide',
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Popper: ['popper.js', 'default']
})
);
+environment.loaders.delete('nodeModules');
module.exports = environment; I think that There is also a known issue with mapbox-gl: #2131 (comment) |
Hey thanks for the reply, this didnt resolve the issue.. Now, I get the same errors when I run |
No, we know that
I am pretty confident that webpacker 4 will help resolve this issue. Just be sure to lightly read the upgrade guide, these are the parts that relate to your problem: |
Thanks again @jakeNiemiec , I cleared my app of any and all things webpacker and mapbox, ran a fresh install of webpacker 4.x, and reinstalled mapbox. Now I get a whole new set of errors, but my research seem to circle back to the same posts.
My API Key/Token is set in my
not sure what the above errors means, but my research has led me back to this post. If I choose to use: If I chose to exclude node_modules from being transpiled by babel-loader: Of the two choices, the second option: |
In this case
It is regex, this is an extensive topic that you can read about here https://webpack.js.org/configuration/module/#rule-conditions
No, the problem is that the |
All set here! @jakeNiemiec , your suggestions worked, thanks for the support! |
Precompiling assets failed & unmet peer dependency
Hello Everyone,
I'm having issues pushing to Heroku. As requested @jakeNiemiec I'm opening a new issue and posting as much code as possible.
Status:
I recently implemented webpacker into an existing (older) program. I followed the instructions for installing webpacker 3.5, installed all the dependencies (I think), and updated. I ran
yarn upgrade
with no success #1078. I have added the "heroku/nodejs" build packs to my heroku configuration #2254, but that didnt work. I ran therails assets:precompile
, and that didnt work.. I have also ref severalpackage.json
updates suggested in #395 , and nothing seems to work.. I have no ideas what else to do..In development, my code runs fine with no issues. My styles, JS, remotes and Mapbox function properly.
Issue:
When attempting to push to Heroku, my app fails to compile. I have several issues within the
.node/modules/
, but this seems to be a symptom of the issue, not the issue itself. Is there something wrong with my dependencies, webpacker version, webpacker.yml or babel?CODE:
here is the failed Heroku build log:
package.json
babel.config.js
config/webpack/environment.js
webpacker.yml
./app/javascript/packs/application.js
app/javascript/plugins/init_mapbox.js
app/view/layouts/application.html.erb
Cheers everyone!
The text was updated successfully, but these errors were encountered: