fix(scan): use fileURLToPath for the entrypoint scan root (Windows) - #296
Merged
thejackshelton merged 1 commit intoSep 2, 2026
Merged
Conversation
scanQwikEntrypoints used config.root.pathname as the grep cwd and as the base for resolve(). On Windows that value is "/C:/project/", which is not a valid filesystem path: spawn fails with ENOENT, the error is swallowed, no entrypoints are found, the standalone client build is skipped, and every QRL reports Q14 during prerender. Convert the root URL with fileURLToPath so the cwd and the resolved absolute paths are native on every platform. Add unit tests that scan a real temp directory.
|
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.
Problem
scanQwikEntrypointsusesconfig.root.pathnameas thecwdfor thegrepspawn and as the base forresolve(). On Windows that value is/C:/project/, which is not a valid filesystem path.spawnfails withENOENT,grepQwikFilesswallows the error and returns"", so:Reproduction on Windows with the code from 1.1.0:
grepitself is on PATH (Git for Windows). The cwd is the failure.Fix
Convert the root URL with
fileURLToPath(config.root). That yields a native path on every platform, so both thecwdand the resolved absolute entrypoint paths are correct. One line, no behaviour change on POSIX.This is the minimal version of #292. It does not add a Node fallback for hosts without
grep; it only fixes the path.Tests
Added
scanQwikEntrypointsunit tests that scan a real temp directory (one Qwik file, one plain file, one match undernode_modules) and assert the native absolute path is returned and the filter is honoured. The first test fails on the current code on Windows and passes with the fix.Note: two pre-existing
resolveQwikPathstests already fail on Windows because they compare against/-separated strings. Left out of scope here.