kit icon indicating copy to clipboard operation
kit copied to clipboard

adapter-vercel creates ISR symlinks for `__data.json` files for server routes

Open Rich-Harris opened this issue 1 year ago • 1 comments

Describe the bug

adapter-vercel creates symlinks for routes with config.isr, but also creates symlinks for their subsidiary __data.json routes (both symlinks point at the same underlying route), which ensures that responses get ISR'd whether you hit the route directly or via client-side navigation.

This should only apply to pages, however — it should not apply to server routes. Currently, it does. (Maybe it should only apply to pages that export a load function? Not sure.)

In theory this should be harmless (though I guess it adds to the number of routes, and there's a limit to that number) but the existence of this unnecessary symlink appears to be triggering a separate bug related to ISR that is outside SvelteKit's control. In any case, it's messy and we should remove it

Reproduction

  • use adapter-vercel
  • add export const config = { isr: { expiration: 1000 } }; to a src/routes/blah/+server.js file
  • build the site
  • note the existence of .vercel/functions/blah/__data.json.func and associated __data.json.prerender-config.json

Logs

No response

System Info

latest

Severity

annoyance

Additional Information

No response

Rich-Harris avatar Sep 19 '24 15:09 Rich-Harris

We are having huge problems because of this issue..

mvd3698 avatar Oct 10 '24 08:10 mvd3698