-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix: repair href
attribute mismatches
#13032
Conversation
🦋 Changeset detectedLatest commit: fbd234a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The reasoning in #9662 turns out to be false: While it's true that the href would resolve to the same URL on the initial page, once you're doing a client-side navigation to a URL at a different depth, the relative path would now point to the wrong location. Therefore we need to repair href hydration mismatches fixes sveltejs/kit#12254
728ee3a
to
61bae04
Compare
I'm not following — if you're navigating client-side then you're not hydrating, so you wouldn't reach this code |
Imagine you have a layout like <!-- +layout.svelte -->
<script>
import { base } from "$app/paths";
</script>
<a href="{base}/">home</a>
<a href="{base}/foo">foo</a>
<slot /> You start at |
Ah, I see. We still need to ignore mismatches for The other cases where an |
This reverts commit fa43304.
…estion is covered by the one immediately below
The reasoning in #9662 turns out to be false: While it's true that the href would resolve to the same URL on the initial page, once you're doing a client-side navigation to a URL at a different depth (and the link stays around, for example because it's in a layout), the relative path would now point to the wrong location. Therefore we need to repair href hydration mismatches
fixes sveltejs/kit#12254
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint