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

Upgrade to Vite 4 #7543

Merged
merged 23 commits into from
Dec 9, 2022
Merged

Upgrade to Vite 4 #7543

merged 23 commits into from
Dec 9, 2022

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Nov 7, 2022

Shouldn't affect SvelteKit or its users much other than bumping a version. One nice change is that it fixes the value of NODE_ENV to be more inline with what one would expect, which I think should help us clean some stuff up

To migrate, simply bump your Vite and SvelteKit versions to the latest versions. See the full Vite 4 migration guide and announcement for more details

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2022

🦋 Changeset detected

Latest commit: 8c12306

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

@benmccann benmccann mentioned this pull request Nov 28, 2022
Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this broke paths.assets handling. investigating

@Rich-Harris Rich-Harris merged commit 1e3bd4f into master Dec 9, 2022
@Rich-Harris Rich-Harris deleted the vite-4 branch December 9, 2022 18:06
This was referenced Dec 9, 2022
@Bandit
Copy link

Bandit commented Dec 11, 2022

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: vite@4.0.0. No idea why?

@benmccann
Copy link
Member Author

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

@Bandit
Copy link

Bandit commented Dec 11, 2022

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: vite@3.2.5
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/kit@1.0.0-next.582
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

@benmccann
Copy link
Member Author

npm ERR! Found: vite@3.2.5
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

@Bandit
Copy link

Bandit commented Dec 11, 2022

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

@sifferhans sifferhans mentioned this pull request Dec 16, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Vite 4
5 participants