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

chore: build path compatibility with nodejs v20 #2464

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SpanManX
Copy link

@SpanManX SpanManX commented Feb 19, 2025

The expression path.dirname(new URL(import.meta.url).pathname) returns a path with a double G:\ prefix on nodejs v20, causing path resolution errors. Modify it using a ternary operator to make it compatible with nodejs v20.

Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for vue-router ready!

Name Link
🔨 Latest commit 5acfc22
🔍 Latest deploy log https://app.netlify.com/sites/vue-router/deploys/67b5ac2f22eab00007809eb2
😎 Deploy Preview https://deploy-preview-2464--vue-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

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

Thanks! I think we can make this so it doesn’t require __dirname anymore. The same code would probably work in all cases without win32 cases

@SpanManX
Copy link
Author

Thanks! I think we can make this so it doesn’t require __dirname anymore. The same code would probably work in all cases without win32 cases

Change the code to "const __dirname = path.dirname(fileURLToPath(import.meta.url))".

@SpanManX SpanManX requested a review from posva February 19, 2025 12:02
@SpanManX SpanManX changed the title File path compatibility with Windows fix: File path compatibility with nodejs v20 Feb 21, 2025
@posva posva changed the title fix: File path compatibility with nodejs v20 chore: build path compatibility with nodejs v20 Feb 23, 2025
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.

2 participants