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

Update Vite and vite-plugin-svelte (proper fix for hydration issue?) #2

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

arcataroger
Copy link
Member

@arcataroger arcataroger commented Dec 12, 2024

Well... this is embarrassing. This was the much simpler (and probably more "correct") fix for datocms/datocms-svelte#14 (the svelte:head hydration issue).

We just needed to upgrade vite and vite-plugin-svelte to the next major versions, which is what the official Svelte demo uses.

What we had:

  "@sveltejs/vite-plugin-svelte": "^4.0.0",
  "vite": "^5.4.4"

What the official demo has:

"devDependencies": {
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
  "vite": "^6.0.0"
}

(from https://github.com/sveltejs/cli/blob/main/packages/create/templates/minimal/package.template.json)

Upgrading those (after deleting the lockfile and regenerating it) fixed the hydration issue, even with [email protected]. So I guess that PR was unnecessary and the if-then inside the head worked fine as it was =(

Sorry about that. I spent a bit trying to create a minimal example for Svelte but couldn't, then started to investigate package versions. I didn't look into this previously because I thought whoever upgraded that starter to Svelte 5 probably did the same for the other libs... apparently not yet lol.

@arcataroger arcataroger self-assigned this Dec 12, 2024
Copy link

vercel bot commented Dec 12, 2024

@arcataroger is attempting to deploy a commit to the DatoCMS Team on Vercel.

A member of the Team first needs to authorize it.

@arcataroger arcataroger added the bug Something isn't working label Dec 12, 2024
@stefanoverna stefanoverna merged commit 44d297b into datocms:main Dec 13, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants