New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack Compilation Error: #80
Comments
Hi @mrkamel thanks for the report. It looks likes it's failing to compile because of the optional chaining (that
I assume you're using webpack 4? We aren't using TypeScript (we're using Babel), but I think this is the specific issue that likely applies. You may be able to hopefully solve it by setting your Also thanks for the note about the README still referencing out of date Cypress config, we'll update that as well. |
As mentioned in #80, our README still had plugin installation instructions for older versions of Cypress. This updates the instructions and links to the official Cypress docs as well.
Thanks for the quick answer and help. I already tried changing the target to various values, including ES2019, but it unfortunately didn't help. Outcome is exactly the same. |
Assuming you're using webpack 4 and if upgrading to webpack 5 isn't possible for you at the moment, you may need to force the later version of |
you can add preprocessor like this |
Also ran into this. I setup cypress for without a preprocessor (e.g webpack). So the error was thrown from cypress's builtin webpack config which isn't handling conditional chaining. The above solution adding |
Closing with provided solution above, reopen if issue returns and this fix does not work! |
After installing cypress-playback according to the README, besides the fact that recent cypress versions no longer seem to support the cypress/plugins approach, but rather want
setupNodeEvents
within cypress.config.ts (see https://docs.cypress.io/guides/references/migration-guide#Plugins-File-Removed) we get... which looks like the es6 features make webpack unhappy. We are using cypress 11.1.0, but also tried out 12.6.0 with same outcome. We are using typescript. I tried to use a custom webpack preprocessor with cypress which is quite fiddly and also didn't help as i ran into other confusing issues then. Also tried to change cypress/support/commands.ts to commands.js, but didn't help as well.
Do you have any advice how to fix it? Thanks in advance.
Environment
The text was updated successfully, but these errors were encountered: