Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge docs for v10.8.0 release #1763

Merged
merged 4 commits into from May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions website/docs/options.md
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
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
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