- Notifications
You must be signed in to change notification settings - Fork37k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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 in6200f19
| const__dirname=path.dirname(fileURLToPath(import.meta.url)); |
bpasero commentedOct 15, 2024
But I would not call out "ESM" specifically, this is just the way of doing it now 🤔 |
bpasero commentedOct 15, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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... |
jamesharris-garmin commentedOct 15, 2024
Thanks everyone for the quick turn around on this. |
prasanthcakewalk commentedOct 16, 2024
May not be worth changing anything, but I think the import here:
is not necessary, since dirname has already been imported here:
I think the import line could be removed and |
bpasero commentedOct 16, 2024
Yes thanks, will address that. |
…r-cliFix missing __dirname in --locate-shell-integration-path
This patchfixes#230584 by applying the recommended fix from:
https://masteringjs.io/tutorials/node/__dirname-is-not-defined