#Error: Cannot find module 'node:crypto'

8 messages · Page 1 of 1 (latest)

patent salmon
#

I have recently migrated to next 15.0.2 version and I started seeing this error.

Any suggestions on how I can fix it?

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

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

patent salmon
#

Here is the error trace

Error: Cannot find module 'node:crypto': Unsupported external type Url for commonjs reference
    at <unknown> (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/0e041_@workos-inc_node_lib_bd1d6a._.js:92:15)
    at [project]/node_modules/.pnpm/@[email protected]/node_modules/@workos-inc/node/lib/common/crypto/node-crypto-provider.js [middleware] (ecmascript) (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/0e041_@workos-inc_node_lib_bd1d6a._.js:95:3)
    at <unknown> (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/edge-wrapper_b19704.js:693:27)
    at runModuleExecutionHooks (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/edge-wrapper_b19704.js:738:9)
    at instantiateModule (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/edge-wrapper_b19704.js:691:9)
    at getOrInstantiateModuleFromParent (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/edge-wrapper_b19704.js:624:12)
    at commonJsRequire (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/edge-wrapper_b19704.js:157:20)
    at [project]/node_modules/.pnpm/@[email protected]/node_modules/@workos-inc/node/lib/index.js [middleware] (ecmascript) (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/0e041_@workos-inc_node_lib_bd1d6a._.js:5320:32)
    at <unknown> (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/edge-wrapper_b19704.js:693:27)
    at runModuleExecutionHooks (file:///Users/johnversus/Work/master-calculator/.next/server/edge/chunks/edge-wrapper_b19704.js:738:9)
stone compass
patent salmon
#

How can I fix it?

stone compass
#

depends on what u trying to achieve

patent salmon
#

The only import I have in my middleware for @workos-inc/authkit-nextjs. I guess the error is coming from this package?

import { authkitMiddleware } from "@workos-inc/authkit-nextjs";
split jetty
#

It is using crypto, which middleware doesn't support