Hello there. I am new to React Router 7 world. I am trying to port my nextjs app to react router 7 app.
I am getting error while trying to use some node:crypto stuff.
During developement:
client:174 Error: Module "node:crypto" has been externalized for browser compatibility. Cannot access "node:crypto.createCipheriv" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
at Object.get (__vite-browser-external:node:crypto:3:11)
at aes.ts:1:63
During build: (pasted photo)
Why is browser trying to run this code when this is intended to run on server side only. Mere importing is giving these error.
I am using turbo repo and these are from the shared utils packages that is using node:crypto for aes.