You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cache): load storage drivers through file URLs - #971
On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
Use a file URL for the cache driver during Nitro startup, with a local path alias for server bundling. Native Windows startup still needs confirmation.
No actionable comments were generated in the recent review.
Walkthrough
The cache storage configuration now uses a file URL for the driver path and adds an alias from that URL to the local driver path. It leaves an existing application cache mount unchanged. Tests cover native ESM loading from a path with spaces and URL-special characters, existing-mount preservation, and alias resolution.
The change passes the cache driver as a file URL and aliases it to the local path, which addresses the Windows loader error in #970. No concrete defect was found in the reviewed diff. Native Windows startup still needs the author's confirmation.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: cache storage drivers are now loaded through file URLs. It matches the summarised change in cache-config.ts, where the driver path is converted to a file URL. It follo…
Description check
The description links issue #970, explains the Windows startup error with drive-letter paths such as c:, and states the approach: a file URL for the cache driver plus a local path alias for server bun…
Linked Issues check
Issue #970 requires Nuxt startup to succeed on Windows. The default ESM loader rejects a drive-letter path such as c: as a URL scheme. At the reviewed head, ensureNuxtScriptsCacheStorage in `packa…
Out of Scope Changes check
The reviewed production change in cache-config.ts is limited to the cache driver path. It adds the pathToFileURL import, an optional alias field on the local options type, and the file-URL mount…
Full details: Title check
Explanation
The title names the main change: cache storage drivers are now loaded through file URLs. It matches the summarised change in cache-config.ts, where the driver path is converted to a file URL. It follows the conventional commit form and is specific enough for a reviewer scanning history.
Full details: Description check
Explanation
The description links issue #970, explains the Windows startup error with drive-letter paths such as c:, and states the approach: a file URL for the cache driver plus a local path alias for server bundling. This matches the raw summary. It also notes that native Windows startup is still unconfirmed.
Full details: Linked Issues check
Explanation
Issue #970 requires Nuxt startup to succeed on Windows. The default ESM loader rejects a drive-letter path such as c: as a URL scheme. At the reviewed head, ensureNuxtScriptsCacheStorage in packages/script/src/runtime/server/utils/cache-config.ts converts the cache driver path with pathToFileURL(driver).href and stores that file: URL as the mount driver. It also adds nitroOptions.alias[driverURL] = driver, so Rollup can bundle the driver from a local path. The file read confirms this behaviour. The mount is created only when no kv or storage mount exists, so application-configured mounts are preserved. The summary reports tests for native ESM loading from a path with special characters on Nitro v2 and v3, mount preservation, and alias resolution in test/unit/cached-upstream-lifecycle.test.ts. I did not read the test file directly. The diff tool was unavailable for this review, so the changes since the previous reviewed head were not confirmed by diff. The file content at head matches the previous assessment. The PR description states that native Windows startup still needs confirmation. This is manual verification and not a coding requirement, so it does not change the verdict.
Full details: Out of Scope Changes check
Explanation
The reviewed production change in cache-config.ts is limited to the cache driver path. It adds the pathToFileURL import, an optional alias field on the local options type, and the file-URL mount and alias logic. Each of these supports the #970 objective. The summary reports test changes in test/unit/cached-upstream-lifecycle.test.ts that check the same behaviour. No unrelated production change appears in the summary or in the reviewed file. The diff tool was unavailable, so I could not confirm the full changed-file list against the merge base. This leaves a small uncertainty about files outside the summary, but the summary lists only the two in-scope files.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. A person still decides the merge.
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
harlan-agent-readyThe automated Review passed every gate on this head commit.
1 participant
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.
🔗 Linked issue
Closes #970
📚 Description
Issue #970 reports Windows startup failing with:
Use a file URL for the cache driver during Nitro startup, with a local path alias for server bundling. Native Windows startup still needs confirmation.