forked from Klaveness-Digital/cypress-cucumber-preprocessor
-
-
Notifications
You must be signed in to change notification settings - Fork 153
Closed
Description
Description
Cypress component tests fail to run when the webpack dependency is updated from 5.97.1 to version 5.98.0 or any later version. The issue does not appear to affect end-to-end (e2e) tests in other projects, suggesting it is specific to component testing.
This error also occured to me eventually when I added some step (a new Then/When) and saved the file (not sure it helps).
Steps to reproduce
- Acess the codesandbox and fork the repo: https://codesandbox.io/p/devbox/cypress-cucumber-3y4jwl
- Open the terminal
- Run
yarnto install dependencies - Run
yarn cy:runto execute the tests. The tests should pass at this stage - Open the
package.jsonfile - Change the
webpackversion from5.97.1to5.98.0 - In the terminal, run
yarnagain to update the dependencies - Run
yarn cy:runin the terminal
Observe that the Cypress component tests now fail.
Version 5.98.0 (and all above)


Full error:
1) An uncaught error was detected outside of a test:
TypeError: The following error originated from your test code, not from Cypress.
> Cannot read properties of null (reading 'replace')
When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.
Cypress could not associate this error to any specific test.
We dynamically generated a new test to display this failure.
at maybeRetrievePositionFromSourceMap (http://localhost:8080/__cypress/src/vendors-node_modules_badeball_cypress-cucumber-preprocessor_dist_entrypoint-browser_js-node_m-d01cc3.js:2416:39)
at Registry.defineStep (http://localhost:8080/__cypress/src/vendors-node_modules_badeball_cypress-cucumber-preprocessor_dist_entrypoint-browser_js-node_m-d01cc3.js:2868:75)
at defineStep (http://localhost:8080/__cypress/src/vendors-node_modules_badeball_cypress-cucumber-preprocessor_dist_entrypoint-browser_js-node_m-d01cc3.js:1594:35)
at ./cypress/integration/common/when.step.tsx (webpack://storybook-webpack-react/./cypress/integration/common/when.step.tsx:7:0)
at __webpack_require__ (http://localhost:8080/__cypress/src/main.js:2709:42)
at ./cypress/integration/features/check-tree.feature (webpack://storybook-webpack-react/./cypress/integration/features/check-tree.feature:5:4)
at __webpack_require__ (http://localhost:8080/__cypress/src/main.js:2709:42)
at __webpack_require__.t (http://localhost:8080/__cypress/src/main.js:2757:38)Desired behavior
The Cypress component tests should pass regardless of the webpack version (5.97.1, 5.98.0, or later). The update to webpack should not cause the tests to fail.
Cypress version
14.3.2
Preprocessor version
22.0.1
Node version
20.12.0
Operating system
Ubuntu 22.04
Checklist
- I've read the FAQ.
- I've read instructions for logging issues.
- I'm not using
[email protected](package name has changed and it is no longer the most recent version, see #689).
Metadata
Metadata
Assignees
Labels
No labels
