sveltejs / sveltejs/kit

adapter-vercel - `isr` config does not respect undefined `allowQuery` value

Open
#11,686 0 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

The jsdoc for config.isr.allowQuery suggests that leaving it undefined will allow all query parameters to be cached independently. This matches up with Vercel's documentation.

However, leaving it undefined makes it so that all query parameters are ignored. This is because the adapter code sets the output allowQuery to always cache the query param '__pathname' on this line.

Because of this, there is currently no way to allow all query parameters to be cached independently.

There are multiple potential solutions:

  • Add ability to set allowQuery: "*" or similar configuration
    • Pro - no breaking change
    • Con - adapter config will have different behavior than vercel docs
  • Fix jsdoc to match current behavior
    • Pro - no breaking change
    • Con - unable to allow all query params
  • Fix behavior to match vercel docs
    • Pro - behavior will stay in line with vercel docs
    • Con - likely a breaking change as default behavior will change
Reproduction

https://github.com/mass8326/sveltekit-isr-allow-query-issue
https://sveltekit-isr-allow-query-issue.vercel.app/?hello=world

Logs

No response

System Info
N/A
Severity

serious, but I can work around it

Additional Information

No response

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

Inspect packages/adapter-vercel/index.js around line 194 and the config documentation in packages/adapter-vercel/index.d.ts around lines 54-57. Reproduce the behavior with the linked example, then establish which undefined allowQuery semantics should be supported; done means the chosen behavior, implementation, and documentation agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cloud
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.