I’ve migrated a react-scripts
web-app from React 17 to 18 over the last 3 weeks. Everything works, including the Cypress component tests, only the Cypress E2E tests won’t execute.
Error:
Error: Webpack Compilation Error
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
My other web-app also does not use any additional “loaders” and the E2E test works there.
What I tried so far:
- looking the whole day on the internet for possible issues
- compared against a similar web-app, which doesn’t produce this error (same dependencies, test setup, etc.)
- tried to create a reproducer app, but it also does not reproduce the error so far
- using
DEBUG=cypress:* npm run cypress-e2e...
which does not give me more info afaik - looking through all files and in imports, disabled some import, with no success
- removing all dependencies which are not in the other, working web-app
- I’ve checked all 137 changed files in the PR (CI also produces this error): no binaries added
Question: How can I get the path of the file causing this error?
As I wrote above, I have a second web-app which is very similar to the one producing this error but it can run the E2E tests successfully. I don’t see what the difference is.
5