kit icon indicating copy to clipboard operation
kit copied to clipboard

Vite 6

Open benmccann opened this issue 1 year ago • 5 comments
trafficstars

Experimental. WIP

benmccann avatar May 29 '24 00:05 benmccann

🦋 Changeset detected

Latest commit: d704a1c547ed5ed6c1a3f9e628d7077a7ae4de48

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

changeset-bot[bot] avatar May 29 '24 00:05 changeset-bot[bot]

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: https://github.com/vitejs/vite/pull/17317

benmccann avatar Jul 31 '24 21:07 benmccann

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:

https://github.com/sveltejs/kit/blob/6056ba30e29ac5747c356fbf1a42dd71f2c4aa1f/packages/kit/test/apps/basics/test/client.test.js#L450

benmccann avatar Aug 24 '24 15:08 benmccann

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

teemingc avatar Aug 25 '24 03:08 teemingc

SvelteKit is now green in vite-ecosystem-ci. Upgrading to [email protected] should work out the issues in this PR.

patak-dev avatar Aug 28 '24 12:08 patak-dev

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

this is an automated message

Rich-Harris avatar Nov 27 '24 04:11 Rich-Harris

Hi, when will this pull request be merged?

musakose46 avatar Nov 29 '24 07:11 musakose46