Next.js Discord

Discord Forum

Error: The edge runtime does not support Node.js 'crypto' module.

Unanswered
Chow Chow posted this in #help-forum
Open in Discord
Chow ChowOP
At first I used bcryptjs and I got this error.

Error: The edge runtime does not support Node.js 'crypto' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime

I tried to replace bcryptjs with argon2 and jose and also created api routs for signup and signin and added runtime:"nodejs" in signup signin and [...nextauth] route

and now this error:



Error: Cannot find module 'node:crypto': Unsupported external type Url for commonjs reference


Files that are relevant to the problem:

2 Replies

Northeast Congo Lion
This is true. Edge is not node, and thus does not have the node-specific APIs. The node:crypto module is a node thing.
what is the alternative?