Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental Static Regeneration (ISR) not working with rest parameters #10836

Closed
pdrbrnd opened this issue Oct 5, 2023 · 1 comment · Fixed by #11928
Closed

Incremental Static Regeneration (ISR) not working with rest parameters #10836

pdrbrnd opened this issue Oct 5, 2023 · 1 comment · Fixed by #11928
Labels
pkg:adapter-vercel Pertaining to the Vercel adapter

Comments

@pdrbrnd
Copy link

pdrbrnd commented Oct 5, 2023

Describe the bug

A sveltekit project with ISR (vercel adapter) and the following structure:

routes/
├─ foo/
│  ├─ [...path]/
│  │  ├─ +page.svelte
│  ├─ +layout.server.ts (adding ISR)

will cause /foo to error when visiting directly or refreshing.
Other paths (like /foo/bar) will work.

It's possible to make it work by adding an extra page:

routes/
├─ foo/
│  ├─ [...path]/
│  │  ├─ +page.svelte
│  ├─ +layout.server.ts
│  ├─ +page.svelte --- HERE

Related with #10155 (possibly duplicated and, if so, I apologize)

I first encountered the issue when working on a project that has optional parameters with matchers and rest parameters ([[region=region]]/[[lang=lang]]/[...path]).
I kept removing parts and the issue seems to happen even with just the rest parameters.

Reproduction

Complete example with "workaround"
https://github.com/pdrbrnd/sveltekit-isr
https://sveltekit-isr-mu.vercel.app/

Minimal example
https://github.com/pdrbrnd/sveltekit-isr/tree/minimal
https://sveltekit-isr-git-minimal-pedrobrandao.vercel.app/

Logs

No response

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M2
    Memory: 129.11 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.1 - ~/.nvm/versions/node/v20.5.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.8.0 - ~/.nvm/versions/node/v20.5.1/bin/npm
    Watchman: 2023.08.07.00 - /opt/homebrew/bin/watchman
  Browsers:
    Brave Browser: 115.1.56.20
    Chrome: 117.0.5938.132
    Safari: 17.0
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.0
    @sveltejs/adapter-vercel: ^3.0.3 => 3.0.3
    @sveltejs/kit: ^1.20.4 => 1.25.1
    svelte: ^4.0.5 => 4.2.1
    vite: ^4.4.2 => 4.4.11

Severity

serious, but I can work around it

Additional Information

No response

@rohanrajpal
Copy link

Question, now if i invalidate this layout endpoint, will it invalidate all the endpoints in its children, or do i have to manually invalidate the specific child i have to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:adapter-vercel Pertaining to the Vercel adapter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants