Frequently asked questions
June 30, 2026 · View on GitHub
Frequently asked questions
- I get
fs_1.promises.rm is not a function - I get
state.messages.current.findLastIndex is not a function --env/tagsisn't picked up- Negated tags / complex tag expressions aren't working as expected on Windows
- JSON reports aren't generated in open / interactive mode
- I get
cypress_esbuild_preprocessor_1.createBundler is not a function - I get
cypress_esbuild_preprocessor_1.default is not a function - I get
Cannot find module '@badeball/cypress-cucumber-preprocessor/esbuild' - My JSON report isn't generated in run mode
- I get
Unexpected state in <state-handler>: <state> - I get
Webpack Compilation Error(shown below) - Why is
cypress-tagsmissing? - Function members
And(..)andBut(..)are missing - Can I use Browserify as a bundler?
- Which preprocessor version should I choose?
- Incompatibility with
@cypress/grep
I get fs_1.promises.rm is not a function
Upgrade your node version to v18.0.0, which is the minimum required version.
I get state.messages.current.findLastIndex is not a function
Upgrade your node version to v18.0.0, which is the minimum required version.
--env / tags isn't picked up
This might be because you're trying to specify -e / --env multiple times, but multiple values should be comma-separated.
Negated tags / complex tag expressions aren't working as expected on Windows
Windows / CMD.EXE users must be aware that single-quotes bear no special meaning and should not be used to group words in your shell. For these users, only double-quotes should be used for this purpose. What this means is that, for these users, running cypress run --env tags='not @foo' is not going to behave and double-quotes must be used. Furthermore, similar scripts contained in package.json should also use double-quotes (escaped necessarily, as that is JSON).
JSON reports aren't generated in open / interactive mode
JSON reports aren't generated in open / interactive mode. They rely on some events that aren't available in open-mode, at least not without experimentalInteractiveRunEvents: true. However, this experimental flag broke some time ago, ref. cypress-io/cypress#18955, cypress-io/cypress#26634. There's unfortunately little indication that these issues will be fixed and meanwhile reports will not be available in open / interactive mode.
I get cypress_esbuild_preprocessor_1.createBundler is not a function
This can happen if you have a TypeScript Cypress configuration (IE. cypress.config.ts as opposed to cypress.config.js) similar to one of our examples and have a tsconfig.json without { "compilerOptions": { "esModuleInterop": true } }.
If you're really adamant about not using esModuleInterop: true, you can change
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
.. to
import * as createBundler from "@bahmutov/cypress-esbuild-preprocessor";
However, I recommend just using esModuleInterop: true if you don't fully understand the implications of disabling it.
I get cypress_esbuild_preprocessor_1.default is not a function
See answer above.
I get Cannot find module '@badeball/cypress-cucumber-preprocessor/esbuild'
Set compilerOptions.moduleResolution to node16 in your tsconfig.json. Users that are unable to upgrade moduleResolution to node16, can use the paths property as a workaround, like shown below.
{
"compilerOptions": {
"paths": {
"@badeball/cypress-cucumber-preprocessor/*": ["./node_modules/@badeball/cypress-cucumber-preprocessor/dist/subpath-entrypoints/*"]
}
}
}
My JSON report isn't generated in run mode
You may have stumbled upon a configuration caveat (see docs/configuration.md: Caveats / Debugging) or are overriding some of the plugin's own event handlers (see docs/event-handlers.md: On event handlers).
I get Unexpected state in <state-handler>: <state>
You might be overriding some of the plugin's own event handlers (see docs/event-handlers.md: On event handlers).
I get Webpack Compilation Error (shown below)
Error: Webpack Compilation Error
Module parse failed: Unexpected token (2:21)
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
This virtually always means that you have misconfigured @cypress/webpack-preprocessor. Here's an example of the crucial configuration value, for which when missing generates the error above.
This is usually seen when users are diverging from the examples by EG. placing preprocessor configuration in cypress/plugins/index.js (which some blog posts reference despite this being deprecated) or by placing webpack-specific content in webpack.config.js (or similar) and not referencing this file in cypress.config.js.
Why is cypress-tags missing?
The cypress-tags executable has been removed and made redundant. Specs containing no matching scenarios are automatically filtered, provided that filterSpecs is set to true.
Function members And(..) and But(..) are missing
These have been deprecated to reflect cucumber-js' behavior. You can still however use the And keyword in .feature files. As explained on SO,
Andis only used in scenarios, not as step definition methods. Semantically it means "same keyword as in previous step"; technically it is just another step. In fact, you can useGiven(),When()andThen()interchangeably in your step definitions, Cucumber will not enforce a match between the step keyword and the step definition function.
Can I use Browserify as a bundler?
Yes. Support for Browserify was removed in v24.0.0, but you can still use v23.x.y. Updates to this library will seldomly be backported to the v23-line of versions, so users are recommended to switch bundler. Moreever, this line is not subject to semver, so pinning to the current minor version is also recommended (IE. ~23.x.y instead of ^23.x.y in package.json).
$ npm install @badeball/cypress-cucumber-preprocessor@23
Examples illustrating use of Browserify can be found here.
Which preprocessor version should I choose?
The observant reader might have noticed that there's a NPM package named cypress-cucumber-preprocessor and @badeball/cypress-cucumber-preprocessor. This is merely a result of maintainer and ownership transfer. The package cypress-cucumber-preprocessor is severely outdated by now and as far as I (the current maintainer) know, there's no reason to be using it.
In any case, choose one over the other and don't attempt to mix these, essentially different packages, in the same project.
Incompatibility with @cypress/grep
Unfortunately, @cypress/grep is fundamentally unsupported together with this library. While your code might not error, the reports generated are likely erroneous and nonsensical.