镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(cache): load storage drivers through file URLs - #971

Open
harlan-zw wants to merge 1 commit into
mainfrom
fix/issue-970
Open

harlan-zw wants to merge 1 commit into
mainfrom
fix/issue-970

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Closes #970

📚 Description

Issue #970 reports Windows startup failing with:

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.

Nitro receives a file URL for native imports. A local path alias keeps the driver in the server bundle.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scripts-playground Ready Ready Preview Oct 26, 2026 4:15pm UTC

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts-devtools@971
npm i https://pkg.pr.new/@nuxt/scripts@971

commit: 3b8318d

@github-actions

Copy link
Copy Markdown

📦 Package Size

⚠️ 3 size metrics grew

📚 22 runtime dependencies (no change)

Package output Gzipped Δ
@nuxt/scripts · dist/runtime 104 kB → 104 kB 🔴 +84 B (+0.1%)
@nuxt/scripts · published payload 223 kB → 223 kB 🔴 +84 B (+0.0%)
@nuxt/scripts · server runtime 30 kB → 30 kB 🔴 +84 B (+0.3%)
All tracked output (25)
Package output Gzipped Raw
@nuxt/scripts-cli · runtime dependencies 72 kB 355 kB ✅
@nuxt/scripts-cli · dependency magicast 72 kB 355 kB ✅
@nuxt/scripts-cli · export . 3.4 kB 12 kB ✅
@nuxt/scripts-cli · published payload 3.4 kB 12 kB ✅
@nuxt/scripts · runtime dependencies 543 kB 2.40 MB ✅
@nuxt/scripts · dependency @oxc-project/types 0 B 0 B ✅
@nuxt/scripts · dependency @vueuse/core 178 kB 720 kB ✅
@nuxt/scripts · dependency @vueuse/shared 39 kB 152 kB ✅
@nuxt/scripts · dependency lru-cache 141 kB 623 kB ✅
@nuxt/scripts · dependency semver 25 kB 72 kB ✅
@nuxt/scripts · dependency sirv 8.8 kB 21 kB ✅
@nuxt/scripts · dependency unstorage 70 kB 225 kB ✅
@nuxt/scripts · dependency valibot 82 kB 590 kB ✅
@nuxt/scripts · dist/runtime 104 kB 306 kB 🔴
@nuxt/scripts · export . 26 kB 106 kB ✅
@nuxt/scripts · export ./registry 30 kB 94 kB ✅
@nuxt/scripts · export ./stats 13 kB 92 kB ✅
@nuxt/scripts · export ./types-source 49 kB 247 kB ✅
@nuxt/scripts · published payload 223 kB 846 kB 🔴
@nuxt/scripts · app runtime 176 B 658 B ✅
@nuxt/scripts · components runtime 2.5 kB 6.4 kB ✅
@nuxt/scripts · composables runtime 7.8 kB 26 kB ✅
@nuxt/scripts · registry runtime 46 kB 136 kB ✅
@nuxt/scripts · server runtime 30 kB 89 kB 🔴
@nuxt/scripts · utils runtime 2.9 kB 8.1 kB ✅
Runtime dependencies (22)
Package Dependency Requested Resolved Cost
@nuxt/scripts-cli magicast ^0.5.5 0.5.5 📦 72 kB gzip
@nuxt/scripts-cli pathe ^2.0.3 2.0.3 ♻️ free via Nuxt 4.6.0
@nuxt/scripts @nuxt/kit ^4.6.0 4.6.0 ♻️ free via Nuxt 4.6.0
@nuxt/scripts @oxc-project/types ^0.153.0 0.153.0 📦 0 B gzip
@nuxt/scripts @vueuse/core ^15.0.0 15.0.0 📦 178 kB gzip
@nuxt/scripts @vueuse/shared ^15.0.0 15.0.0 📦 39 kB gzip
@nuxt/scripts consola ^3.4.2 3.4.2 ♻️ free via Nuxt 4.6.0
@nuxt/scripts defu ^6.1.7 6.1.7 ♻️ free via Nuxt 4.6.0
@nuxt/scripts lru-cache ^11.5.3 11.5.3 📦 141 kB gzip
@nuxt/scripts magic-string ^1.4.3 1.4.3 ♻️ free via Nuxt 4.6.0
@nuxt/scripts ofetch ^1.5.1 1.5.1 ♻️ free via Nuxt 4.6.0
@nuxt/scripts ohash ^2.0.12 2.0.12 ♻️ free via Nuxt 4.6.0
@nuxt/scripts oxc-walker ^1.1.1 1.1.1 ♻️ free via Nuxt 4.6.0
@nuxt/scripts pathe ^2.0.3 2.0.3 ♻️ free via Nuxt 4.6.0
@nuxt/scripts semver ^7.8.5 7.8.5 📦 25 kB gzip
@nuxt/scripts sirv ^3.0.2 3.0.2 📦 8.8 kB gzip
@nuxt/scripts std-env ^4.3.0 4.3.0 ♻️ free via Nuxt 4.6.0
@nuxt/scripts ufo ^1.6.4 1.6.4 ♻️ free via Nuxt 4.6.0
@nuxt/scripts ultrahtml ^1.7.0 1.7.0 ♻️ free via Nuxt 4.6.0
@nuxt/scripts unplugin ^3.4.0 3.4.0 ♻️ free via Nuxt 4.6.0
@nuxt/scripts unstorage ^1.17.5 1.17.5 📦 70 kB gzip
@nuxt/scripts valibot ^1.5.0 1.5.0 📦 82 kB gzip

Baseline: main_@_321e7574___2026-10-13 · gzip is the comparison metric · changes below 16 B gzip are ignored

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: efeda725-e505-46cb-b96a-7bbd08ca05f5
Commits

Reviewing files that changed from the base of the PR and between 321e757 and 3b8318d.

Files selected for processing: 2
  • packages/script/src/runtime/server/utils/cache-config.ts
  • test/unit/cached-upstream-lifecycle.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this 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.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 3b831

No concrete merge-blocking risk is established by the supplied evidence.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "fix(cache): load storage drivers through file URLs" matches the main change. The raw summary shows cache-config.ts converting the driver path to a file URL and mapping it with a nitro alias…
Description check Passed The description links issue #970 and explains the Windows startup failure caused by the absolute path being read as a file URL protocol. It states that the cache driver uses a file URL during Nitro st…
Linked Issues check Passed Issue #970 requires Windows-safe loading of the cache driver. ensureNuxtScriptsCacheStorage converts the driver path with pathToFileURL, configures Nitro with the resulting file: URL, and adds a…
Out of Scope Changes check Passed All reviewed changes support issue #970. The alias and cache-mount tests verify the required runtime behaviour and bundling support. No unrelated production or test changes are shown.
Full details: Title check

Explanation

The title "fix(cache): load storage drivers through file URLs" matches the main change. The raw summary shows cache-config.ts converting the driver path to a file URL and mapping it with a nitro alias. The title follows conventional commits and names the fix and its scope. It does not mention the Windows startup symptom, but it is specific enough for a reviewer to understand the primary change.

Full details: Description check

Explanation

The description links issue #970 and explains the Windows startup failure caused by the absolute path being read as a file URL protocol. It states that the cache driver uses a file URL during Nitro startup with a local path alias for server bundling. This matches the changeset. The description also notes that native Windows startup is not yet confirmed.

Full details: Linked Issues check

Explanation

Issue #970 requires Windows-safe loading of the cache driver. ensureNuxtScriptsCacheStorage converts the driver path with pathToFileURL, configures Nitro with the resulting file: URL, and adds an alias from that URL to the local path for bundling. The tests cover native ESM loading from a path with spaces and URL-special characters, application mount preservation, and alias resolution. These changes address the reported c: loader error.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@harlan-zw harlan-zw added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 27, 2026
@harlan-zw

harlan-zw commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

🤖 READY · 88/100

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.

  • Merge gate: Passed.
  • Review gate: Passed. No material issues.
  • CI gate: Passed.

@harlan-zw harlan-zw added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 27, 2026

This branch was successfully deployed

1 active deployment
Preview — 3b8318d1 Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

harlan-agent-ready The automated Review passed every gate on this head commit.

Projects

None yet

1 participant