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

fix(cli): inspect flag is deprecated #10819

Merged
merged 1 commit into from Mar 4, 2020
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
9 changes: 4 additions & 5 deletions docs/api-reference/cli.md
Expand Up @@ -25,17 +25,16 @@ Available commands

Options
--version, -v Version number
--inspect Enable the Node.js inspector
--help, -h Displays this message

For more information run a command with the --help flag
$ next build --help
```

You can pass any node arguments to `next` commands:
You can pass any [node arguments](https://nodejs.org/api/cli.html#cli_node_options_options) to `next` commands:

```bash
NODE_OPTIONS="--throw-deprecation" next
NODE_OPTIONS="-r esm" next
NODE_OPTIONS="--inspect" next
NODE_OPTIONS='--throw-deprecation' next
NODE_OPTIONS='-r esm' next
NODE_OPTIONS='--inspect' next
```
3 changes: 1 addition & 2 deletions packages/next/bin/next.ts
Expand Up @@ -63,7 +63,6 @@ if (!foundCommand && args['--help']) {

Options
--version, -v Version number
--inspect Enable the Node.js inspector
--help, -h Displays this message

For more information run a command with the --help flag
Expand All @@ -77,7 +76,7 @@ const forwardedArgs = foundCommand ? args._.slice(1) : args._

if (args['--inspect'])
throw new Error(
`Use env variable NODE_OPTIONS instead: NODE_OPTIONS="--inspect" next ${command}`
`--inspect flag is deprecated. Use env variable NODE_OPTIONS instead: NODE_OPTIONS='--inspect' next ${command}`
)

// Make sure the `next <subcommand> --help` case is covered
Expand Down