Component testing with Vite is failing due to the outdated bundled `graceful-fs` version
See original GitHub issueCurrent behavior
Component testing with Vite in new projects doesn’t work. There will be errors like:
[vite] Internal server error: Cannot read properties of undefined (reading 'uid') Failed to fetch dynamically imported module: http://localhost:3001/src/components/__tests__/HelloWorld.spec.js?import
The direct cause is the latest version of resolve
. It exposes a bug in older versions of graceful-fs
.
Because Cypress bundles graceful-fs
by itself, there seems no way for users to fix it by themselves.
More technical details is explained at https://github.com/browserify/resolve/issues/264#issuecomment-1006948040
Desired behavior
Update the bundled graceful-fs
version to >= 4.2.9
Test code to reproduce
https://github.com/robyedlin/vue3-starter
Cypress Version
9.2.0
Other
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:16 (2 by maintainers)
Top Results From Across the Web
Component testing with Vite is failing due to the outdated ...
The direct cause is the latest version of resolve . It exposes a bug in older versions of graceful-fs . Because Cypress bundles...
Read more >cypress failed to fetch dynamically imported module - You.com
During component testing, if I run cypress open-ct , chrome opens fine, ... with Vite is failing due to the outdated bundled `graceful-fs`...
Read more >Frontend testing standards and style guidelines - GitLab Docs
Frontend testing standards and style guidelines. There are two types of test suites encountered while developing frontend code at GitLab.
Read more >Testing Vite with minimal config using Vitest - LogRocket Blog
Edit a React component only used on your homepage, for example? Instead of re-bundling your entire site as webpack might, Vite will send...
Read more >Changelog - Cypress Documentation
Users working in React Component Testing projects can now generate a basic spec ... wizard would fail to run in global mode on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ljharb the issue has nothing to do with svelte.
In my case it is getting thrown from the Cypress app bundle. Cypress app bundles graceful-fs from where this error is thrown. Here’s the error snippet that shows the source of the error.
Released in
9.3.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v9.3.0, please open a new issue.