Callback handler failed. CAUSE: [unenv] crypto.createCipheriv is not implemented!
I am encountering a problem when trying to deploy my Next.js app to :cloudflare: Workers after adding Auth0. I'm using:
- @opennextjs/cloudflare": "^0.3.3
- "@auth0/nextjs-auth0": "^3.5.0"
This is my route.ts file:
package.json scripts:
My build runs fine after
I've found a similar issue here and cont'd here, where vicb mentions that
pnpm run preview:worker
and I'm able to access the app locally at localhost:8771 ; however, when I try to access api/auth/login, I'm met with the following error:
When I run pnpm run dev
on localhost:3000 everything is functioning -- I believe it's because I'm able to access the Node runtime, which has the crypto module.I've found a similar issue here and cont'd here, where vicb mentions that
crypto.createCipheriv
is not yet implemented by workerd.
I saw a post from Brett Willis in #workers-discussions mentioning that :cloudflare: Workers supports the Web Crypto APIs and the equivalents there are crypto.subtle.encrypt()
and crypto.subtle.decrypt()
.
I'm new to Next.js and Cloudflare, so if anyone can give me some recommendations on how to resolve this issue it would be greatly appreciated, thanks.GitHub
[BUG] NewtAuth errors with [unenv] crypto.createCipheriv is not imp...
Describe the bug When next-auth is used and next-auth related functions are executed, the following error occurs. [wrangler:err] TypeError: Cannot assign to read only property 'cache' of ob...
GitHub
[Feature] Implement crypto.createCipheriv · Issue #3277 · cloudflar...
crypto.createCipheriv is required by Next Auth. See opennextjs/opennextjs-cloudflare#206 Can we prioritize the implementation of the API? @jasnell The crypto APIs are used by Next from crypto-utils.ts
0 Replies