fix(ui): resolve Windows path generation bug in openapi-ts resulting in ENOENT errors#15056
Merged
elevatebart merged 2 commits intokestra-io:developfrom Mar 13, 2026
Conversation
…n-openapi-ts-resulting-in-ENOENT-errors
elevatebart
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a critical cross-platform issue in openapi-ts.config.ts
that prevents Windows users from successfully running npm install and generating the OpenAPI client bundle.
Problem
On Windows environments, running npm run generate:openapi (triggered during npm install postinstall) crashes with the following error:

Root Cause
The bug occurs due to how new URL(import.meta.url).pathname behaves on Windows. When converting the module's file:// protocol to a path, the native JS URL object yields a string with a leading forward slash before the drive letter (e.g., /E:/kestra/ui/openapi-ts.config.ts).
When Node's path.resolve() combines this with a relative string, it perceives the leading slash as an absolute path from root, prepending the local drive letter again. This results in the illegal double-drive-letter folder path (E:\E:...), crashing the application during the directory mkdir step.
Solution
Replaced the basic URL parsing with Node's native fileURLToPath standard library method. This method correctly interprets the file:// scheme on all host operating systems, ensuring that paths generated on Windows accurately match standard Windows File System conventions.