-
Notifications
You must be signed in to change notification settings - Fork 200
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
Vitest bug: "Error: ENOENT: no such file or directory" #763
Comments
It looks like your project's In Miniflare v3 we've added a new way to run unit tests against your Workers using the actual Workers runtime ( |
The tests don't depend on the build files and running the tests in a node environment doesn't throw an error so why would running them in a miniflare environment throw an error?
I migrated the example to Miniflare v3 and the original error went away but now I can't see how to integrate Miniflare v3 into the main project (https://github.com/kubetail-org/edge-csrf). In the main project, I'm testing the code in different environments by switching the vitest
However, miniflare v3 doesn't use the |
When I run vitest with the
miniflare
environment I get a missing file error due to one of the build files not being present. Here's a minimal vite project that reproduces the error:https://github.com/amorey/miniflare-vitest-bug
In this particular example, the error is that the build artifact
dist/main.cjs
is missing. If I remove the"main"
definition from package.json, the error goes away.The text was updated successfully, but these errors were encountered: