Skip to content
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

Error: Webpack Compilation Error (Module parse failed: Unexpected token) (optional chaining operator) #254

Closed
ghost opened this issue Sep 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Sep 3, 2024

Hello, I am trying to use cypress-terminal-report 6.1.2 (the latest version).

When Cypress runs with this new plugin, it prints this:

Error: Webpack Compilation Error
./node_modules/cypress-terminal-report/src/collector/LogCollectSimpleControl.js 44:48
Module parse failed: Unexpected token (44:48)
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
|     }
| 
>     if (testState === 'failed' && mochaRunnable?._retries > 0) {
|       testTitle += ` (Attempt ${mochaRunnable?._currentRetry + 1})`
|     }
 @ ./node_modules/cypress-terminal-report/src/installLogsCollector.js 18:32-78
 @ ./cypress/support/e2e.ts

After some investigation, I found the issue might be the "optional chaining operator", and it is introduced from this commit (ea03e69).

I switched cypress-terminal-report to version 6.0.2 (without above commit), and it works.

Is "optional chaining operator" valid in this project? Or might the user (Cypress user) change some configuration to overcome this? I can use version 6.0.2, but perhaps the latest version can address this issue as well.

Thanks

@archfz
Copy link
Owner

archfz commented Sep 3, 2024

This was semi reported already and PR was submitted #250

I am waiting for @wemcdonald to fix the PR and I will do a release ASAP. If he doesn't respond I will replicate the changes.

@archfz archfz added the bug Something isn't working label Sep 3, 2024
@archfz
Copy link
Owner

archfz commented Sep 3, 2024

Released in 6.1.3

@archfz archfz closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant