You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/troubleshooting.md
+6-3
Original file line number
Diff line number
Diff line change
@@ -93,12 +93,12 @@ This error is thrown by node when a module is `require()`d, but node believes it
93
93
- You have installed an ESM dependency but your own code compiles to CommonJS.
94
94
- Solution: configure your project to compile and execute as native ESM. [Docs](./commonjs-vs-native-ecmascript-modules.md#native-ecmascript-modules)
95
95
- Solution: downgrade the dependency to an older, CommonJS version.
96
-
- You have moved your project to ESM but still have a config file, such as `webpack.config.js`, which must be executed as CommonJS
97
-
- Solution: if supported by the relevant tool, rename your config file to `.cjs`
96
+
- You have moved your project to ESM but still have a config file, such as `webpack.config.ts`, which must be executed as CommonJS <!-- SYNC_WITH_MTO_DOCS -->
97
+
- Solution: if supported by the relevant tool, rename your config file to `.cts`
98
98
- Solution: Configure a module type override. [Docs](./module-type-overrides.md)
99
99
- You have a mix of CommonJS and native ESM in your project
100
100
- Solution: double-check all package.json "type" and tsconfig.json "module" configuration [Docs](./commonjs-vs-native-ecmascript-modules.md)
101
-
- Solution: consider simplifying and switch to all CommonJS or all native ESM
101
+
- Solution: consider simplifying by making your project entirely CommonJS or entirely native ESM
102
102
103
103
### `ERR_UNKNOWN_FILE_EXTENSION`
104
104
@@ -109,6 +109,9 @@ This error is thrown by node when a module has an unrecognized file extension, o
109
109
- Solution: upgrade to ts-node >=[v10.6.0](https://github.com/TypeStrong/ts-node/releases/tag/v10.6.0), which implements a workaround.
110
110
- Our ESM loader is not installed.
111
111
- Solution: Use `ts-node-esm`, `ts-node --esm`, or add `"ts-node": {"esm":true}` to your tsconfig.json. [Docs](./commonjs-vs-native-ecmascript-modules.md#native-ecmascript-modules)
112
+
- You have moved your project to ESM but still have a config file, such as `webpack.config.ts`, which must be executed as CommonJS <!-- SYNC_WITH_MTO_DOCS -->
113
+
- Solution: if supported by the relevant tool, rename your config file to `.cts`
114
+
- Solution: Configure a module type override. [Docs](./module-type-overrides.md)
0 commit comments