Skip to content

Document that vercel functions should be created as SvelteKit endpoints #781

Closed
@josefaidt

Description

@josefaidt

Hello team 👋, really enjoying the svelte-kit experience so far!

One thing I noticed is when using vercel's serverless functions alongside a svelte-kit app there are a few nuances and unintended side effects, namely with client-side code not executing in local dev when svelte-kit is wrapped with vercel dev

minimal example repo: https://github.com/josefaidt/svelte-kit-vercel-local-issue

With vercel dev which executes svelte-kit dev -p $PORT and gives us the API routes
image

With svelte-kit dev, no API routes
image

When the application is deployed to vercel, everything appears fine! This seems to only affect local development.

I've since found a way around this behavior and I am fully aware svelte-kit is in beta so this will likely change, however I wanted to bring it up and reach out in case I am going against the grain with this setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpkg:adapter-vercelPertaining to the Vercel adapter

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions