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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte 5 (5.0.0-next.167): Upgrading to the latest Svelte 5 breaks SvelteKit routing #12228

Closed
Serator opened this issue Jun 30, 2024 · 9 comments 路 Fixed by #12242
Closed

Svelte 5 (5.0.0-next.167): Upgrading to the latest Svelte 5 breaks SvelteKit routing #12228

Serator opened this issue Jun 30, 2024 · 9 comments 路 Fixed by #12242

Comments

@Serator
Copy link

Serator commented Jun 30, 2024

Describe the bug

Page content is not rendered when going to the next page

iShot_2024-06-30_02.56.25.mp4

Reproduction

Logs

No response

System Info

Binaries:
    Node: 20.10.0 - /usr/local/bin/node
    npm: 10.2.3 - /usr/local/bin/npm
  Browsers:
    Chrome: 126.0.6478.127
    Chrome Canary: 128.0.6566.0
    Firefox Nightly: 124.0a1
    Safari: 17.5
  npmPackages:
    svelte: 5.0.0-next.167 => 5.0.0-next.167

Severity

blocking an upgrade

@lumosminima
Copy link

SvelteKit SPA are broken too, navigations aren't resetting the layout and previous page's DOM and {#await} calls get overlapped. Reloading works as shown above. Thought I missed a breaking change in changelong but it doesn't say anything about this.

@zachczx
Copy link

zachczx commented Jun 30, 2024

Same for me, upgrading to 167 broke routing for dev server. A hard refresh solves it. Preview mode doesn't carry this issue.

@JonathanPicques
Copy link

Having the same issue, navigating back and forth using the history remounts the page under the one that should have been unmounted

image

@Hyp3rbole
Copy link

Hyp3rbole commented Jun 30, 2024

Having the same issue. Breaks navigation, requires a refresh to render page.

@jeremieguy1
Copy link

jeremieguy1 commented Jun 30, 2024

Facing the same issue since the 167 (ok in 166), thanks for the report !

dummdidumm added a commit that referenced this issue Jul 1, 2024
The refactoring in #12215 didn't take HMR into account. As a result, the anchor was passed to the HMR block, which was subsequently cleaned up on destroy - but the anchor could be shared with other components and therefore needs to stay in the dom. Passing `null` instead solves the problem.
Fixes #12228
@pheuter
Copy link

pheuter commented Jul 1, 2024

Still seeing similar rendering issues during client-side routing with next.168, where the first client-side navigate to a new route appears to succeed, but all subsequent ones do not render.

@mylastore
Copy link

mylastore commented Jul 1, 2024

I went back to next.166 and it started working again.

@frederikhors
Copy link

@dummdidumm Please re-open this: is broken with 167, 168 and 169. 166 OK.

@pheuter
Copy link

pheuter commented Jul 2, 2024

next.169 works if you temporarily disable hmr in your svelte.config.js:

compilerOptions: {
    hmr: false
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants