Iām having problem redeploying my frontity project to vercel. I used to deploy succefully. Ever since I upgraded node to 18 I couldnāt run the app.
I downgraded node to v.16.18.1 and was able to run frontity locally. But I still canāt deploy to vercel.
The error is the following:
Error: error:0308010C:digital envelope routines::unsupported
09:45:21.927 at new Hash (node:internal/crypto/hash:71:19)
09:45:21.927 at Object.createHash (node:crypto:133:10)
09:45:21.928 at module.exports (/vercel/path0/node_modules/webpack/lib/util/createHash.js:135:53)
09:45:21.928 at NormalModule._initBuildHash (/vercel/path0/node_modules/webpack/lib/NormalModule.js:417:16)
09:45:21.928 at handleParseError (/vercel/path0/node_modules/webpack/lib/NormalModule.js:471:10)
09:45:21.928 at /vercel/path0/node_modules/webpack/lib/NormalModule.js:503:5
09:45:21.928 at /vercel/path0/node_modules/webpack/lib/NormalModule.js:358:12
09:45:21.928 at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:373:3
09:45:21.929 at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
09:45:21.929 at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
09:45:21.929 at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:236:3
09:45:21.929 at context.callback (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
09:45:21.930 at /vercel/path0/node_modules/babel-loader/lib/index.js:59:71
09:45:21.961 Error: Command ānpm run buildā exited with 1.
OKey guys, I have an update for this. I did a lot of investigation and looking at resources and PRs from the vercel team.
So because there is now node 18.x you actually need to specify the node version in the engines in your package.json, like this:
"engines": {
"node": "16.x"
},
At first I thought its a bug as based on my testing, when using a custom builder the engines property was ignored. I talked to some engineers at vercel and they said that its not a bug, it simply didnt affect out build before, because 16.x was the latest available version or something like this.
I will also share this same message here: WARNING: All your builds using @frontity/now will break as of August 9th 2022 - #18 by anantajitjg as this is where we were tracking a similar issue.
You need to do it exactly like in the code i pasted. It wont work with anything higher than version 16. So just replace the engines part you have with this:
Did it, still gives the same error back. I also tried from other PC-s, older and newer commits as well. Nothing seems to work, I am really under the weather because of this issue.
Can you guys try to make a sandbox with from your repo to see if it still behaves like this? Then we know if its an issue with your own env or if its from something else.
I am quite busy those days but I will try to help u as much as possible.
Downgrade to node 16 (you need to have nvm and node 16.18.1 installed):
nvm use 16.18.1
Now install yarn:
npm install --global yarn
Run yarn (is simulates the ānpm installā command)
yarn
Last step is run develop:
yarn frontity dev
If you have error messages during these steps, put them here so we can have a look at. I also had some dependencies which gave back an error because they did not work with react 16 or node 16, I had to uninstall those dependecies and find other solution.
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\Users\User\Desktop\Next.js\ReactWordpress\test-app\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.