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: don't inject NODE_OPTIONS in Deno #2080

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

lucacasonato
Copy link
Contributor

In Deno 2, Deno has a process global. Because of this this extension tries to inject environment variables into the process through the inspector using process.env. However when running Deno without I/O permissions (the default), accessing process.env.* will show a permission prompt. This is confusing for users, as their code did not trigger this prompt, but the extensions' injected code did.

Because this code doesn't do anything in Deno anyway (because we do not respect NODE_OPTIONS), there is no point in running it in Deno at all. This commit disables this injection code path in Deno through environment detection.

In Deno 2, Deno has a `process` global. However when running Deno without I/O permissions (the default), accessing process.env.* will show a permission prompt. This is confusing for users, as their code did not trigger this prompt, but VS Code did.

Because this code doesn't do anything in Deno anyway (because we do not respect `NODE_OPTIONS`), there is no point in running it in Deno at all. I disable the code path in Deno through environment detection now.
Copy link
Member

@connor4312 connor4312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@connor4312 connor4312 enabled auto-merge (squash) September 13, 2024 14:37
@vs-code-engineering vs-code-engineering bot added this to the September 2024 milestone Sep 13, 2024
@connor4312 connor4312 merged commit 7dbdd01 into microsoft:main Sep 13, 2024
7 checks passed
@lucacasonato lucacasonato deleted the node_options_deno branch September 13, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants