server fetch
for relative asset paths in Vercel are broken since @sveltejs/kit
2.7.0
#12868
Labels
pkg:adapter-vercel
Pertaining to the Vercel adapter
Describe the bug
Since
@sveltejs/kit
2.7.x, using serverfetch
for relative asset paths in Vercel serverless functions are broken.The Vercel logs show:
I believe this is because since #12113, SvelteKit is now automatically trying to use
kit/packages/adapter-vercel/files/serverless.js
Line 13 in b2acab8
Reproduction
See https://github.com/aloisklink/sveltekit-2.7.0-issue-reproduction (click the ✔️ next to each commit to view the Vercel previews), where I've made the following function handler:
For aloisklink/sveltekit-2.7.0-issue-reproduction@1d0eedf (which uses
@sveltejs/kit
2.6.4), going to https://sveltekit-2-7-0-issue-reproduction-kdo5046wh.vercel.app/test works fine.However, for aloisklink/sveltekit-2.7.0-issue-reproduction@57e0b61 (which uses
@sveltejs/kit
2.7.2), going to https://sveltekit-2-7-0-issue-reproduction-85gm4ombo.vercel.app/test does not work, and shows the above message in the logs.Logs
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'favicon.png'
}
Or just the messages:
System Info
Severity
blocking an upgrade
Additional Information
Maybe we can partially revert the performance enhancement change to
packages/kit/src/runtime/server/fetch.js
in #12113. It will slow down Cloudflare/Netlify and cause extra unnecessary requests there, but I don't think it would cause any other issues.Maybe adding a check to see if
file in manifest._.server_assets
would also work, since my.svelte-kit/output/server/manifest.js
has an emptymanifest._.server_assets
object, but I'm not familiar with Cloudflare/Netlify, so I don't know if it will work there.The text was updated successfully, but these errors were encountered: