Seeing a cryto.hash error when building the FE, an...
# dev-help
q
Seeing a cryto.hash error when building the FE, any clue whats up?
✅ 1
Copy code
(base) rohitmalhotra@Rohits-Laptop Openhands % make build-frontend
Building frontend...

> openhands-frontend@0.49.0 prepare
> cd .. && husky frontend/.husky


> openhands-frontend@0.49.0 build
> npm run make-i18n && react-router build


> openhands-frontend@0.49.0 make-i18n
> node scripts/make-i18n-translations.cjs

TypeError: crypto.hash is not a function
    at getHash (file:///Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/vite/dist/node/chunks/dep-Bg4HVnP5.js:2788:21)
    at getLockfileHash (file:///Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/vite/dist/node/chunks/dep-Bg4HVnP5.js:11673:9)
    at getDepHash (file:///Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/vite/dist/node/chunks/dep-Bg4HVnP5.js:11676:23)
    at initDepsOptimizerMetadata (file:///Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/vite/dist/node/chunks/dep-Bg4HVnP5.js:11137:53)
    at createDepsOptimizer (file:///Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/vite/dist/node/chunks/dep-Bg4HVnP5.js:34621:17)
    at new DevEnvironment (file:///Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/vite/dist/node/chunks/dep-Bg4HVnP5.js:35385:109)
    at Object.defaultCreateClientDevEnvironment [as createEnvironment] (file:///Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/vite/dist/node/chunks/dep-Bg4HVnP5.js:35804:9)
    at _createServer (file:///Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/vite/dist/node/chunks/dep-Bg4HVnP5.js:28376:132)
    at BasicMinimalPluginContext.configResolved (/Users/rohitmalhotra/Documents/Openhands/Openhands/frontend/node_modules/@react-router/dev/dist/vite.js:3221:29)
    at async Promise.all (index 2)
make: *** [build-frontend] Error 1
f
That's weird, try
rm -rf node_modules/ package-lock.json
then try again
q
hmm didn't work
i may have to nuke the repo
f
Are you trying to build it on the main branch?
q
Nope on my branch - but CI in github is able to build it but I'm unable to do it locally
Hmm re-cloned the entire repo still didn't work Not working on my personal branch or main
what version of node should i be running?
ok nvm i'm running an older version
f
Ohh, what version were you running?
q
20x instead of 22x
c
Oh, interesting. We just removed support for 20.x these weeks
😲 1
q
okay that fixed it thanks!