Next.js Discord

Discord Forum

HookWebpackError since changing to Node18 in Vercel project settings

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Sloth bearOP
Upon changing to node 18 in the project settings, my build fails and produces the following error:
HookWebpackError: error:0308010C:digital envelope routines::unsupported
    at makeWebpackError (/vercel/path0/<project>/node_modules/next/dist/compiled/webpack/bundle5.js:45539:9)
    at /vercel/path0/<project>/node_modules/next/dist/compiled/webpack/bundle5.js:29467:12
    at eval (eval at create (/vercel/path0/<project>/node_modules/next/dist/compiled/webpack/bundle5.js:141008:10), <anonymous>:101:1)
-- inner error --
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at getHashDigest (/vercel/path0/<project>/node_modules/next/dist/compiled/loader-utils/index.js:1:29141)
    at /vercel/path0/<project>/node_modules/next/dist/compiled/loader-utils/index.js:1:31472
    at String.replace (<anonymous>)
    at Object.interpolateName (/vercel/path0/<project>/node_modules/next/dist/compiled/loader-utils/index.js:1:31381)
    at /vercel/path0/<project>/node_modules/next/dist/build/webpack/plugins/copy-file-plugin.js:41:51
caused by plugins in Compilation.hooks.processAssets


Webpack version is 4.47.0
NextJS version is ^12.0.2
Node version (used in Vercel Deployment) 18.17.1

P.S.: I've read online this has to do with not using a LTS version of Node, but if I remember correctly, 18.17.1 is a LTS version within the 18.x range

0 Replies