Skip to content

Commit a2702f5

Browse files
committed
Document esModuleInterop: true
1 parent 90588e7 commit a2702f5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/faq.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* [Why is `cypress-tags` missing?](#why-is-cypress-tags-missing)
77
* [My JSON report isn't generated](#my-json-report-isnt-generated)
88
* [JSON reports aren't generated in open / interactive mode](#json-reports-arent-generated-in-open--interactive-mode)
9+
* [I get `cypress_esbuild_preprocessor_1.createBundler is not a function`](#i-get-cypress_esbuild_preprocessor_1createbundler-is-not-a-function)
910

1011
## `--env` / `tags` isn't picked up
1112

@@ -30,3 +31,21 @@ You have likely stumbled upon a configuration caveat, see [docs/configuration.md
3031
## JSON reports aren't generated in open / interactive mode
3132

3233
JSON reports aren't typically 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](https://github.com/cypress-io/cypress/issues/18955).
34+
35+
## I get `cypress_esbuild_preprocessor_1.createBundler is not a function`
36+
37+
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 } }`.
38+
39+
If you're really adamant about _not_ using `esModuleInterop: true`, you can change
40+
41+
```ts
42+
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
43+
```
44+
45+
.. to
46+
47+
```ts
48+
import * as createBundler from "@bahmutov/cypress-esbuild-preprocessor";
49+
```
50+
51+
However, I recommend just using `esModuleInterop: true` if you don't fully understand the implications of disabling it.

0 commit comments

Comments
 (0)