kit icon indicating copy to clipboard operation
kit copied to clipboard

Upgrade to Vite 4

Open benmccann opened this issue 3 years ago • 1 comments

Just for testing at the moment. Still quite a ways from a final release

TODO:

  • use newly exported css regex rather than duplicated version here: https://github.com/vitejs/vite/pull/10844

benmccann avatar Nov 07 '22 21:11 benmccann

🦋 Changeset detected

Latest commit: 8c123069314f2e56d0b55918f65f90df20ee7616

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

This PR includes changesets to release 7 packages
Name Type
@sveltejs/kit Patch
@sveltejs/adapter-cloudflare Patch
@sveltejs/adapter-cloudflare-workers Patch
@sveltejs/adapter-netlify Patch
@sveltejs/adapter-vercel Patch
@sveltejs/adapter-node Patch
create-svelte Patch

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 Nov 07 '22 21:11 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
kit ✅ Ready (Inspect) Visit Preview Dec 6, 2022 at 4:52PM (UTC)
kit-svelte-dev ✅ Ready (Inspect) Visit Preview Dec 6, 2022 at 4:52PM (UTC)

vercel[bot] avatar Dec 06 '22 16:12 vercel[bot]

I think we also need a "how to migrate" section in the PR description so people know what to do

i think in this case the how to migrate is self explanatory, just update the required peer dependencies, there is no code change or config change needed as far as i am aware

dominikg avatar Dec 09 '22 14:12 dominikg

Oh, that's a pleasant surprise, nice!

dummdidumm avatar Dec 09 '22 14:12 dummdidumm

I'm probably stupid, but I went into package.json and set

"@sveltejs/kit": "^1.0.0-next.582"
"vite": "^4.0.0"

And then npm i and get Conflicting peer dependency: [email protected]. No idea why?

Bandit avatar Dec 11 '22 02:12 Bandit

I haven't seen that. Can you share a project that reproduces the issue?

benmccann avatar Dec 11 '22 03:12 benmccann

Just tried to recreate the issue in StackBlitz but it seems to work fine, so guessing it's something specific to this (private) repo.

I tried renaming node_modules before running npm i but it gives me basically the same error:

npm ERR! Found: [email protected]
npm ERR! node_modules/vite
npm ERR!   dev vite@"^3.0.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^4.0.0" from @sveltejs/[email protected]
npm ERR! node_modules/@sveltejs/kit
npm ERR!   dev @sveltejs/kit@"^1.0.0-next.582" from the root project

I don't really know where to even start debugging the issue since I don't know a lot about NPM's inner workings. I could use --force or --legacy-peer-deps but that sounds scary

Bandit avatar Dec 11 '22 04:12 Bandit

npm ERR! Found: [email protected] npm ERR! node_modules/vite npm ERR! dev vite@"^3.0.4" from the root project

That sounds like you still have Vite 3 in a package.json somewhere.

Another thing you could try is rm -rf package-lock.json node_modules && npm install

benmccann avatar Dec 11 '22 04:12 benmccann

That fixed it. Really appreciate the help - realise you're not tech support! Not sure what was wrong with my setup 😅

Bandit avatar Dec 11 '22 05:12 Bandit