sveltejs / sveltejs/kit

Named form actions do not work with Vercel ISR.

Open
#11,337 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pkg:adapter-vercel
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

A named form action returns a 500 Internal Error when served from Vercel with ISR.

Reproduction

Steps:

  1. Clone repo: https://github.com/Leftium/kit-demos/tree/isr-actions
  2. Deploy to Vercel
  3. Load / (root path): https://kit-demos-git-isr-actions-leftium.vercel.app/
  4. Click "Submit" button

Expected:

  • "undefined" turns to "true" (the property form.success from return value of form action.)

Actual:

  • 500 Internal Error
  • Vercel log may show error message like "cannot find default form action."
Logs

No response

System Info
System:
    OS: Windows 11 10.0.22621
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
    Memory: 8.99 GB / 23.86 GB
  Binaries:
    Node: 18.18.2 - V:\scoop\apps\nodejs-lts\current\node.EXE
    npm: 9.8.1 - V:\scoop\apps\nodejs-lts\current\npm.CMD
    pnpm: 8.11.0 - V:\pnpm-home\pnpm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.61)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.1
    @sveltejs/kit: ^1.20.4 => 1.30.3
    svelte: ^4.0.5 => 4.2.8
    vite: ^4.4.2 => 4.5.1
Severity

serious, but I can work around it

Additional Information

So the work-arounds are to not use named form actions or not use ISR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the linked kit-demos isr-actions branch and compare the named-action, default-action, and non-ISR pages. Then trace SvelteKit's Vercel ISR form-action handling; done means the named action returns form.success without a 500 error when deployed to Vercel.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.