-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Unable to build on latest NodeJS LTS #1748
Comments
Not sure about that
Can you try setting this env var instead? |
It nullifies the effort the node team has done in NodeJS 18. I have currently adopted this as a hack as a temporary measurement to keep my project going. Longer-term; we should be all using the default openssl provider. |
Correct; it was an issue with webpack itself; but then they put in the
That is why I was motivating: |
No, what it does is fix an issue that broke a huge portion of the Node ecosystem. The Node team of course recognized this and added an option that's meant to be used for exactly this purpose. It doesn't nullify their work at all, nor is the work done to migrate particularly compelling. You'll see 0 difference in normal use cases.
Did you read the linked issue? It's a Webpack issue, and they have no interest in back-porting the fix, unfortunately. Contributions are always welcome if you'd like to help the v4 upgrade where we can move to Webpack v5. See #1647. Going to close this out as there's nothing actionable (that isn't a duplicate). |
Well, evidently it does not. And in light of the other recommendation provided in that same comment working perfectly, I don't find it particularly compelling to investigate at this time. If you do, and are able to suggest a fix to |
Ah; I overlooked this. They have the
so for v4 the only solutions are:
So yeah; since you all are diligently busy with the migration to webpack v5; it makes sense to close this issue; it should work out of the box once you have upgraded to v5.
Thanks for the invitation! |
I evidently did too! That makes more sense.
I wouldn't say that -- it's been started, but isn't going anywhere fast. Part due to lack of time, part due to Webpack feeling quite like legacy tech, especially now that Sokra and co. have created an actual spiritual successor. It's hard to justify spending my time at this point (as that PR shows, it's been only my time) when so many better options exist, albeit with a migration cost attached. |
Just wanted to update this issue for future posterity with a more elegant solution. const crypto = require("crypto");
/**
* md4 algorithm is not available anymore in NodeJS 17+ (because of lib SSL 3).
* In that case, silently replace md4 by md5 algorithm.
*/
try {
crypto.createHash('md4');
} catch (e) {
console.warn('Crypto "md4" is not supported anymore by this Node version');
const origCreateHash = crypto.createHash;
crypto.createHash = (alg, opts) => {
return origCreateHash(alg === 'md4' ? 'md5' : alg, opts);
};
} |
Describe the bug
At latest NodeJS LTS version, getting following error:
I tried resolving it according to recommendation of webpack, by adding inside preact.config.js:
which leads to the next error:
which is on account of the fact that
xxhash64
is a webpack specifc implementation.Considering that preact is based on webpack; I would have expected the above to just work.
To Reproduce
preact build --no-prerender
Expected behavior
What should have happened when following the steps above?
The text was updated successfully, but these errors were encountered: