Skip to content

Latest release v7.0.2 throws Webpack Compilation Error #290

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

Closed
cgutierrezpa opened this issue Aug 23, 2023 · 2 comments · Fixed by #292
Closed

Latest release v7.0.2 throws Webpack Compilation Error #290

cgutierrezpa opened this issue Aug 23, 2023 · 2 comments · Fixed by #292
Assignees
Labels
bug Something isn't working

Comments

@cgutierrezpa
Copy link

cgutierrezpa commented Aug 23, 2023

Describe the bug
Seems like latest release v7.0.2 does not work and it throws a Webpack Compilation Error. It complains about the Elvis operator ?. which is not readable by node, so I guess that the release bundle needs to be compiled into compatible code

To Reproduce

  1. Install cypress-fail-fast: 7.0.2
  2. Set up the code to use the plugin
  3. Run any Cypress test

Expected behavior
Version 7.0.1 does not show this problem and works without problems when running the tests

Logs

Oops...we found an error preparing this test file:

  > src/support/index.ts

The error was:

Error: Webpack Compilation Error
/workspace/project/node_modules/cypress-fail-fast/src/helpers/cypress.js 2:25
Module parse failed: Unexpected token (2:25)
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
| function isHeaded(Cypress) {
>   return Cypress.browser?.isHeaded;
| }
| 
 @ /workspace/project/node_modules/cypress-fail-fast/src/support.js 19:67-95
 @ /workspace/project/node_modules/cypress-fail-fast/index.js
 @ /workspace/project/libs/cypress-commands/src/lib/commands/index.ts
 @ /workspace/project/libs/cypress-commands/src/lib/index.ts
 @ /workspace/project/libs/cypress-commands/src/index.ts
 @ ./src/support/commands/index.ts
 @ ./src/support/index.ts
    at handle (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:212:23)
    at finalCallback (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:257:39)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:306:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:304:22
    at Compiler.emitRecords (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:499:39)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:298:10
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:485:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:482:27
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
    at done (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:464:33
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:143:16
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:143:16
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:61:14
    at FSReqCallback.oncomplete (node:fs:192:23)

This occurred while Cypress was compiling and bundling your test code. This is usually caused by:

- A missing file or dependency
- A syntax error in the file or one of its dependencies

Fix the error in your code and re-run your tests.

** Operating system, Node.js an npm versions, or browser version (please complete the following information):**

  • OS: macOS 13.4.1
  • Node.js: 16.16.0
  • npm: 8.11.0

Additional context
As for other versions, I'm using:

  • Cypress: 12.15.0
  • Typescript: 4.8.4
@sebastianthieledmb2bcom

Same error here.
Cypress: 12.17.3

@javierbrea javierbrea added the bug Something isn't working label Aug 26, 2023
@javierbrea javierbrea self-assigned this Aug 26, 2023
@javierbrea
Copy link
Owner

This seems to be related to this Cypress issue. I will release another fix version for reverting changes until the operator is supported by Cypress. Thanks for the notice!

This was referenced Aug 26, 2023
@javierbrea javierbrea linked a pull request Aug 26, 2023 that will close this issue
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
3 participants