Skip to content

Commit b1ba575

Browse files
authored
Update troubleshooting.md
1 parent 2084c8a commit b1ba575

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

website/docs/troubleshooting.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ This error is thrown by node when a module is `require()`d, but node believes it
9393
- You have installed an ESM dependency but your own code compiles to CommonJS.
9494
- Solution: configure your project to compile and execute as native ESM. [Docs](./commonjs-vs-native-ecmascript-modules.md#native-ecmascript-modules)
9595
- 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`
9898
- Solution: Configure a module type override. [Docs](./module-type-overrides.md)
9999
- You have a mix of CommonJS and native ESM in your project
100100
- 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
102102
103103
### `ERR_UNKNOWN_FILE_EXTENSION`
104104
@@ -109,6 +109,9 @@ This error is thrown by node when a module has an unrecognized file extension, o
109109
- Solution: upgrade to ts-node >=[v10.6.0](https://github.com/TypeStrong/ts-node/releases/tag/v10.6.0), which implements a workaround.
110110
- Our ESM loader is not installed.
111111
- 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)
112115
113116
## Missing Types
114117

0 commit comments

Comments
 (0)