Webpack compilation error
tobloef opened this issue · comments
Whenever I try to run my Cypress tests on version 2.3.1
, I get the webpack compilation error described below. This has already been mentioned in another issue, but I thought it best to create a separate issue for this exact bug.
yarn run v1.22.4
$ C:\Users\toblo\Code\vms\node_modules\.bin\cypress run --headless --quiet --record false
Couldn't find tsconfig.json. tsconfig-paths will be skipped
Oops...we found an error preparing this test file:
cypress\support\index.js
The error was:
Error: Webpack Compilation Error
./node_modules/cypress-react-selector/src/reactHandler.js 124:62
Module parse failed: Unexpected token (124:62)
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
| value = Cypress.$(value);
| }
> return cy.verifyUpcomingAssertions(value, reactOpts?.options, {
| onRetry: resolveValue,
| });
@ ./node_modules/cypress-react-selector/index.js 8:4-33
@ ./cypress/support/index.js
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.
This seems to be caused by the question mark, which is invalid JS syntax. Perhaps some TypeScript isn't being compiled on release or something? The same happens on line 238, as well as twice on line 73 of utils.js
. I did a test where I replaced the question mark with something like this (reactOpts || {}).options
and everything seemed to work.
Downgrading to 2.2.2
also fixed the issue.
fix available in v2.3.2
hey @olumikey198 , It seems the issue with the webpack can not identify the .feature
files. This is not related to this library. You can check with the gherkin/cucumber utility you are using under the hood.