Skip to content

Node.js: Fix support for loadFile() with an URL on Windows #8235

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

tronical
Copy link
Member

@tronical tronical commented Apr 22, 2025

We recommend the use of loadFile(new URL("...", import.metal.url)),
but this never worked on Windows, because we're not using the API
the Node.js docs even recommend to correctly covert to a local path on Windows.

Fixes #8209

@tronical tronical force-pushed the simon/nodejs-windows branch 2 times, most recently from f4c96f9 to dcfd73a Compare April 22, 2025 15:19
@tronical tronical requested a review from ogoffart April 22, 2025 15:19
@tronical tronical changed the title Node.js: Add test for loadFile() taking a URL on Windows Node.js: Fix support for loadFile() with an URL on Windows Apr 22, 2025
We recommend the use of `loadFile(new URL("...", import.metal.url))`,
but this never worked on Windows, because we're not using the API
the Node.js docs even recommend to correctly covert to a local path on Windows.

(Apply the same logic to initTranslations)

Fixes #8209
@tronical tronical force-pushed the simon/nodejs-windows branch from dcfd73a to e07b2d0 Compare April 22, 2025 15:21
@tronical tronical merged commit f94e5a7 into master Apr 22, 2025
40 checks passed
@tronical tronical deleted the simon/nodejs-windows branch April 22, 2025 16:01
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.

Slint's loadFile() method throws an error in Windows OS when passing in a filename string.
2 participants