cypress-loves-vite
cypress-loves-vite copied to clipboard
No component specs found
Context
When following the readme instructions cypress starts, but no component specs are found
Process
yarn
yarn cy
Expected result
All spec files are shown in the cypress window to start the tests
Current result
List is empty
Other Results
I tried npm install
in a newly cloned project, thus using the current versions instead of a lock file. Now the spec files are found but executing them results in an error
HelloWorld.cy.js:13 Not allowed to load local resource: file:///<localpath>/node_modules/@cypress/vite-dev-server/client/initCypressTests.js
(anonymous) @ HelloWorld.cy.js:13
HelloWorld.cy.js:1 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: file:///<localpath>/node_modules/@cypress/vite-dev-server/client/initCypressTests.js
Edit: Windows 10, yarn 1.22.10, node 12.13.1, npm 6.12.1
I'm getting the same error. I'm also on windows. Maybe it's a windows path thing?
Seems like I just need to explicitly set a path somewhere to make the Vite generated source files reference the dev server path rather then a file:// system path.
Sorry guys, yes it was a windows thing. I hope you updated and saw it work on windows too ;)
I'm having this problem for only one test, cypress, vite and react, the rest of the tests are working, what did you update? it is happening randomly.
@antoniormrzz what message do you see?
- No component specs found or
- Not allowed to load local resource:
@elevatebart I see Failed to fetch dynamically imported module: http://localhost:3000/src/FilterMenu/__tests__/FilterMenu.test.tsx?import
randomly, for example, right now it's fine on my machine, but throws this on github actions.