Docs: Append to NODE_OPTIONS, not overwrite #14730
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The suggestion given in the ECMASCRIPT modules docs to add NODE_OPTIONS=--experimental-vm-modules can lead to very hard to track bugs. Debuggers and other tooling can use NODE_OPTIONS, and overwriting it will break them. For me, it was the VSCode debugger that stopped breaking on breakpoints, and it took me the entire day to find this passage in their docs: https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_how-can-i-set-nodeoptions
It seems safer to propose to append to NODE_OPTIONS in the docs, rather than overwriting it.
Test plan
I followed the contributing.md and checked that my changes appears in the website for all versions (including screenshots here only for Next and 29.7 versions for economy of space).
Related issues:
This issue might be related: #12075