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

Vite 6 #12270

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

Vite 6 #12270

wants to merge 38 commits into from

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented May 29, 2024

Copy link

changeset-bot bot commented May 29, 2024

🦋 Changeset detected

Latest commit: d704a1c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@sveltejs/adapter-cloudflare-workers Minor
@sveltejs/adapter-cloudflare Minor
@sveltejs/adapter-netlify Minor
@sveltejs/adapter-vercel Minor
@sveltejs/kit Minor

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

@benmccann
Copy link
Member Author

I think there's a few errors here, but the biggest seems to be that Vite 6 is treating all .json files as being a tsconfig.json and then reloading the server when such a file changes. @dominikg had a PR out for this here: vitejs/vite#17317

@benmccann
Copy link
Member Author

benmccann commented Aug 24, 2024

The changes to the esbuild plugin have been reverted so the prior issue with tsconfck is gone. We're down to two errors now:

  [chromium-dev] › client.test.js:448:2 › Invalidation › server-only load functions are re-run following forced invalidation 
  [chromium-dev] › client.test.js:461:2 › Invalidation › server-only load functions are re-run following goto with forced invalidation 

This can be reproduced locally by running playwright on just that one test (just need to do pnpm install beforehand):

packages/kit/test/apps/basics$ pnpm test:dev -g "server-only load functions are re-run following forced invalidation"

This is the line that's failing while running this route:

expect(await page.textContent('h1')).toBe('a: 0, b: 1');

@eltigerchino
Copy link
Member

eltigerchino commented Aug 25, 2024

It seems that Vite is loading the same module twice: once by the +layout.server module, then again by the +page.server module. However, it should only be loaded once by +layout.server then re-used by +page.server so that they are both incrementing the same count variable.

You can test this by adding a console.log(count) statement at the top level, spin up a dev server, and see it log twice when you access the page for the first time.

https://github.com/sveltejs/kit/blob/main/packages/kit/test/apps/basics/src/routes/load/invalidation/forced/state.js

@patak-dev
Copy link

SvelteKit is now green in vite-ecosystem-ci. Upgrading to vite@6.0.0-alpha.22 should work out the issues in this PR.

@Rich-Harris
Copy link
Member

preview: https://svelte-dev-git-preview-kit-12270-svelte.vercel.app/

this is an automated message

@benmccann benmccann mentioned this pull request Nov 27, 2024
6 tasks
@benmccann benmccann marked this pull request as ready for review November 27, 2024 23:30
@bafratan

This comment was marked as duplicate.

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

Successfully merging this pull request may close these issues.

5 participants