-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 BUG: vitest integration not working with assets #7587
Comments
Hiya, if you're intending to use these assets with the vitest integration, you need wrangler 3.80.1 or later - let me know if you still have issues though! |
Hi @emily-shen,
I found this example: https://github.com/cloudflare/workers-sdk/blob/main/fixtures/vitest-pool-workers-examples/workers-assets/test/assets.test.ts but I cannot figure out why it's not working. BR, |
The issue is easily reproducible on a newly generated worker project. Here is an example: https://github.com/dstr89/cloudflare-vitest-assets-issue/. Steps to reproduce the issue are described in the README. |
. |
Which Cloudflare product(s) does this pertain to?
Miniflare
What version(s) of the tool(s) are you using?
3.60.3 [wrangler], 4.20241216.0 [worker-types], 0.5.2 [vitest-pool-workers]]
What version of Node are you using?
16.20.2
What operating system and version are you using?
Mac Sonoma 14.16.1
Describe the Bug
Observed behavior
After adding the following configuration to expose public assets in my wrangler.toml
I am getting the following error while running
npm run test
:Expected behavior
I noticed that the error goes away if I empty my ASSETS folder. However, then I cannot write an appropriate test. Expected behavior would be for ASSETS to work and not getting a Miniflare error.
Steps to reproduce
Here is my package JSON:
Here. is my wrangler.toml:
The error happens only when running tests, the Worker is working fine on Cloudflare.
Please advise,
Daniel
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: