-
Notifications
You must be signed in to change notification settings - Fork 37.2k
Fix missing __dirname in --locate-shell-integration-path #231423
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
Conversation
Tyriar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm @bpasero could you verify this is the right way to do this now?
bpasero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is:
Line 24 in 6200f19
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); |
|
But I would not call out "ESM" specifically, this is just the way of doing it now 🤔 |
|
Follow up #231427 This is really a good catch and was missed during the ESM migration. We are bitten by the fact that the node.js types declare a global Update: I think we can have a ESLint rule to disallow... |
|
Thanks everyone for the quick turn around on this. |
|
May not be worth changing anything, but I think the import here: vscode/src/vs/server/node/server.cli.ts Line 10 in ffa1857
is not necessary, since dirname has already been imported here:vscode/src/vs/server/node/server.cli.ts Line 12 in ffa1857
I think the import line could be removed and |
|
Yes thanks, will address that. |
…r-cli Fix missing __dirname in --locate-shell-integration-path
This patch fixes #230584 by applying the recommended fix from:
https://masteringjs.io/tutorials/node/__dirname-is-not-defined