Closed
Description
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
3.30.1
What version of Node are you using?
v21.6.1
What operating system and version are you using?
Windows 11
Describe the Bug
Observed behavior
When I run the tests in my repro
npm run test
I observe this error
src/jwt.test.ts [ src/jwt.test.ts ]
TypeError: deprecate is not a function
❯ node_modules/jose/dist/node/esm/runtime/rsaes.js:23:38
The jose library actually works in the production runtime of Cloudflare workers, without the nodejs_compat
flag, but vitest-pool-workers
paradoxically requires the flag.
Expected behavior
The tests work.
Steps to reproduce
Clone https://github.com/vladinator1000/miniflare-node-compat-bug
Run
npm i
npm run test
Please provide a link to a minimal reproduction
https://github.com/vladinator1000/miniflare-node-compat-bug
Please provide any relevant error logs
src/jwt.test.ts [ src/jwt.test.ts ]
TypeError: deprecate is not a function
❯ node_modules/jose/dist/node/esm/runtime/rsaes.js:23:38
I also found a similar issue when using Prisma: prisma/prisma#23193 (comment)
Metadata
Metadata
Assignees
Type
Projects
Status
Done