Skip to content

Commit

Permalink
Merge docs for v10.8.0 release (#1763)
Browse files Browse the repository at this point in the history
* Update options.md

* Update troubleshooting.md

* Update options.md (#1734)

* Update docusaurus.config.js (#1740)
  • Loading branch information
cspotcode authored May 20, 2022
1 parent 6f66541 commit 499b256
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions website/docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ Bootstrap with the ESM loader, enabling full ESM support

```shell
ts-node -P <path/to/tsconfig>
ts-node --project <path/to/tsconfig>
```

Path to tsconfig file.

*Note the uppercase `-P`. This is different from `tsc`'s `-p/--project` option.*

*Environment:* `TS_NODE_PROJECT`

### skipProject
Expand Down
9 changes: 6 additions & 3 deletions website/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ This error is thrown by node when a module is `require()`d, but node believes it
- You have installed an ESM dependency but your own code compiles to CommonJS.
- Solution: configure your project to compile and execute as native ESM. [Docs](./commonjs-vs-native-ecmascript-modules.md#native-ecmascript-modules)
- Solution: downgrade the dependency to an older, CommonJS version.
- You have moved your project to ESM but still have a config file, such as `webpack.config.js`, which must be executed as CommonJS
- Solution: if supported by the relevant tool, rename your config file to `.cjs`
- 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 -->
- Solution: if supported by the relevant tool, rename your config file to `.cts`
- Solution: Configure a module type override. [Docs](./module-type-overrides.md)
- You have a mix of CommonJS and native ESM in your project
- Solution: double-check all package.json "type" and tsconfig.json "module" configuration [Docs](./commonjs-vs-native-ecmascript-modules.md)
- Solution: consider simplifying and switch to all CommonJS or all native ESM
- Solution: consider simplifying by making your project entirely CommonJS or entirely native ESM
### `ERR_UNKNOWN_FILE_EXTENSION`
Expand All @@ -109,6 +109,9 @@ This error is thrown by node when a module has an unrecognized file extension, o
- Solution: upgrade to ts-node >=[v10.6.0](https://github.com/TypeStrong/ts-node/releases/tag/v10.6.0), which implements a workaround.
- Our ESM loader is not installed.
- 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)
- 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 -->
- Solution: if supported by the relevant tool, rename your config file to `.cts`
- Solution: Configure a module type override. [Docs](./module-type-overrides.md)
## Missing Types
Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = {
position: 'right',
},
{
href: 'https://discord.gg/typescript',
href: 'https://discord.gg/3rBctmf3dP',
label: 'Chat',
position: 'right',
},
Expand Down

0 comments on commit 499b256

Please sign in to comment.