Skip to content

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

@Rich-Harris

Description

@Rich-Harris

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpkg:adapter-vercelPertaining to the Vercel adapter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions