sudden webpack compilation error due to file loader
See original GitHub issueCurrent behavior
i’m using:
- osx 12.0.1
- node 16
- create-react-app
- craco
- cypress 9.5.0
- typescript
writing e2e tests with cypress, it’s been fine for a few months, then at a certain point in the project, a compilation error is thrown - Error: Webpack Compilation Error - Unexpected Token
. it’s suddenly dying on css files. i understand about file loaders, but everything was working until a certain point in the commit history.
the commit was trivial, a simple fix to a .tsx file. webpack compiles fine outside of cypress, so the loader config is correct.
it’s as if the project grew too large at this point and webpack compilation inside cypress is just failing for some reason. really confusing.
is there a place that i can find more detailed logging about the webpack build within cypress? this makes no sense to me.
Desired behavior
it should continue working, simple as that.
Test code to reproduce
reproduction steps aren’t really possible to provide in this case without access to the source.
Cypress Version
9.5.0
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:13 (6 by maintainers)
Top GitHub Comments
I had the same error message while updating cypress and testing-library
The problem was when I updated
"@testing-library/dom": "^8.17.1", -> "^8.18.0"
. When I reverted to8.17.1
, cypress ran OK.I am going to close this one since the OP hasn’t responded in while - I don’t see any obvious actionable info here, other than probably updating our deps like webpack etc to have more features out of the box. This will happen but the webpack 5 update is non-trivial, but something I’d like to see before the end of 2022.
In the meantime, if you see this problem, look at my above comment - you need to update your babel config or tsconfig to include the features you want, like
??
.