mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #944] [MERGED] fix: support file:// URLs in cacheHandler config path #972
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#972
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/944
Author: @Divkix
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/29/2026
Merged by: @james-elicx
Base:
main← Head:fix/728-file-url-cache-handler📝 Commits (3)
ef147e7fix: support file:// URLs in cacheHandler config path (#728)34e6f2efix: drop unused export on resolveCacheHandlerPathToFilesysteme4c68d3fix: resolve cacheMaxMemorySize and add cacheHandler tests📊 Changes
2 files changed (+98 additions, -0 deletions)
View changed files
📝
packages/vinext/src/config/next-config.ts(+51 -0)📝
tests/next-config.test.ts(+47 -0)📄 Description
Fixes #728
Summary
cacheHandlerandcacheMaxMemorySizetoNextConfigtype with JSDoc explainingimport.meta.resolve()usagecacheHandlertoResolvedNextConfigwithfile://URL resolutionresolveCacheHandlerPathToFilesystem()utility that convertsfile://URLs to filesystem paths viafileURLToPath()What this does
When
"type": "module"is set inpackage.json, users must useimport.meta.resolve()instead ofrequire.resolve()to resolve the cache handler path.import.meta.resolve()returns afile://URL, which previously would break if used with path operations likepath.joinorpath.relative. The new helper convertsfile://URLs to proper filesystem paths before any path operations.Matches Next.js commit 9a0214a1.
Test plan
next-config.test.tstests pass (test helper updated to include new field)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.