React.lazy component test errors
See original GitHub issueCurrent behavior
I have a simple spec that lazy loads a component (followed the example outlined in the lazy-load advanced examples) which fails to compile correctly with the following error:
The following error originated from your test code, not from Cypress.
> Automatic publicPath is not supported in this browser
I’ve tried to re-set up the whole environment to mirror, as closely as possible, the example link from above. Of note is that I’m using cypress-webpack-preprocessor-v5
instead of what is provided in the example as, subsequently, thats what my project is using as well.
If I comment out the Bar
lazy load on line 3 of src/Foo.js
and the usage of <Bar />
on line 8, the test compiles correctly. I’ve attached a zip file mirroring the whole setup. After downloading, run the following:
npm i
npm test
Desired behavior
The test should pass.
Test code to reproduce
See attached zip file.
Versions
“cypress”: “^6.5.0”, “@cypress/react”: “^5.0.0”, “cypress-webpack-preprocessor-v5”: “^5.0.0-alpha.1”, “webpack”: “^5.22.0”,
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Closing as resolved.
If you’re experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.
This is no longer an issue with the below deps on webpack 5: