🐛 BUG: No such module with @cloudflare/vitest-pool-workers
Which Cloudflare product(s) does this pertain to?
Workers Vitest Integration
What version(s) of the tool(s) are you using?
0.1.17
What version of Node are you using?
20.12
What operating system and version are you using?
Macos sonoma 14
Describe the Bug
Observed behavior
I'm unable to import module, the error is below
Error: No such module "Users/anduc/projects/bannerify/node_modules/.pnpm/[email protected]/node_modules/satori/dist/parse-css-color".
imported from "Users/anduc/projects/bannerify/node_modules/.pnpm/[email protected]/node_modules/satori/dist/index.wasm.js"
Note that parse-css-color is a depedencies of satori
Expected behavior
Import package successfully
Steps to reproduce
It raises the error when I import like this
import satori, { init } from 'satori/wasm'
My settings
poolOptions: {
workers: {
miniflare: {
compatibilityFlags: ['nodejs_compat'],
compatibilityDate: '2023-12-18',
},
},
A git repo we can clone and run a test suit on, or which has a README with step-by-step instructions, is even better. In this case, please use the field below to provide a link to the minimal repro.
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
Hit this also, I'm using the AWS S3 SDK and trying to write some UTs.
Error: No such module "D:/checkouts/test1/autumn-bread-c1f4/node_modules/@aws-crypto/sha1-browser/build/tslib".
❯ node_modules/@aws-crypto/sha1-browser/build/index.js?mf_vitest_no_cjs_esm_shim:4:15
The line it's upset about from the AWS SDK is this:
var tslib_1 = require("tslib");
Looks to me like it's trying to resolve tslib in the wrong place, as per the original post.
Hit this also, I'm using the AWS SnS SDK and trying to write tests:
Error: No such module "Users/rhua/projects/data-tracking-sol-cf-events-worker/node_modules/@aws-sdk/client-sns/node_modules/@aws-crypto/sha256-browser/build/tslib".
❯ Users/rhua/projects/data-tracking-sol-cf-events-worker/node_modules/@aws-sdk/client-sns/node_modules/@aws-crypto/sha256-browser/build/index.js?mf_vitest_no_cjs_esm_shim:4:15
Having a similar issue with a @wix/sdk library. Import only fails on tests, works well with local and prod environments.
+1 , seeing same issue on a project.
+1, same issue here. Would be great if someone from the team could have a look.
Could anyone make a small repro as a git repo so I can have a look? I suspect the latest versions of some packages might resolve this, but would love to see a repro to verify.
please use [email protected] when making the repro
Ok this looks to be a good repro https://github.com/cloudflare/workers-sdk/issues/5646#issuecomment-2062193085
Closing in favour of https://github.com/cloudflare/workers-sdk/issues/5367