rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
5.31k stars 1.47k forks source link

webpacker breaks on node17 with Error: error:0308010C:digital envelope routines::unsupported #3235

Closed TruePath closed 2 years ago

TruePath commented 2 years ago

On node 17 running bin/webpack gives me the error "Error: error:0308010C:digital envelope routines::unsupported" when running webpacker 5.4.3

This is discussed in the webpack issues here which seems to indicate that it's fixed in the very latest version but that might only be for version 5 of webpack.

justin808 commented 2 years ago

can you upgrade to v6.rc6?

justin808 commented 2 years ago

@TruePath I recommend that you don't upgrade to Node 17 yet, and upgrade to webpacker v6 soon.

TruePath commented 2 years ago

Thanks. I mean I have a workaround but I was just trying to be helpful.

And yes, it seems to work fine on rc6 so yah looks like you already got it.

On Sun, Nov 28, 2021 at 2:57 PM Justin Gordon @.***> wrote:

Closed #3235 https://github.com/rails/webpacker/issues/3235.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rails/webpacker/issues/3235#event-5681525354, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5TB3OBET7OWX7YE6WDWDUOKCRFANCNFSM5IXUZ32A .

bigchickenwings commented 1 year ago

can you upgrade to v6.rc6?

@justin808 I have upgraded my Webpacker to v6.rc6, but still can't use it with Node.js 18, which is enforced by Heroku. Do you happen to know if it works with Heroku-22?

My error is extremely similar:

remote:        Compilation failed:
remote:        Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties.
remote:        The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
remote:         ["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
remote:        to the "plugins" section of your Babel config.
remote:        Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-property-in-object.
remote:        The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
remote:         ["@babel/plugin-proposal-private-methods", { "loose": true }]
remote:        to the "plugins" section of your Babel config.
remote:        node:internal/crypto/hash:71
remote:          this[kHandle] = new _Hash(algorithm, xofLen);
remote:                          ^
remote:        
remote:        Error: error:0308010C:digital envelope routines::unsupported
remote:            at new Hash (node:internal/crypto/hash:71:19)
remote:            at Object.createHash (node:crypto:133:10)
remote:            at module.exports (/tmp/build_74a7e258/node_modules/webpack/lib/util/createHash.js:135:53)
remote:            at NormalModule._initBuildHash (/tmp/build_74a7e258/node_modules/webpack/lib/NormalModule.js:417:16)
remote:            at handleParseError (/tmp/build_74a7e258/node_modules/webpack/lib/NormalModule.js:471:10)
remote:            at /tmp/build_74a7e258/node_modules/webpack/lib/NormalModule.js:503:5
remote:            at /tmp/build_74a7e258/node_modules/webpack/lib/NormalModule.js:358:12
remote:            at /tmp/build_74a7e258/node_modules/loader-runner/lib/LoaderRunner.js:373:3
remote:            at iterateNormalLoaders (/tmp/build_74a7e258/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
remote:            at iterateNormalLoaders (/tmp/build_74a7e258/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
remote:            at /tmp/build_74a7e258/node_modules/loader-runner/lib/LoaderRunner.js:236:3
remote:            at context.callback (/tmp/build_74a7e258/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
remote:            at /tmp/build_74a7e258/node_modules/babel-loader/lib/index.js:44:71 {
remote:          opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
remote:          library: 'digital envelope routines',
remote:          reason: 'unsupported',
remote:          code: 'ERR_OSSL_EVP_UNSUPPORTED'
remote:        }
remote:        
remote:        Node.js v18.14.0

Because if does, I'll insist on this solution a little bit more, but if there's no confirmation, I will probably just look for something else!

justin808 commented 1 year ago

@bigchickenwings Please try to use https://github.com/shakacode/shakapacker and report there if there are issues.