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 for Vite 4 #68

Closed
pc-erin opened this issue Dec 9, 2022 · 6 comments · Fixed by #69
Closed

Update for Vite 4 #68

pc-erin opened this issue Dec 9, 2022 · 6 comments · Fixed by #69

Comments

@pc-erin
Copy link

pc-erin commented Dec 9, 2022

Is this compatible with Vite 4?

Can we just bump the peerDependency or are there other changes that need to be made first?

@ilteoood
Copy link

I'm interested in this too.

@C-Ezra-M
Copy link

This has to be done. Upgrading Vite to 4.0.0 caused an upstream dependency conflict, which is only resolvable by downgrading Vite.

@ilteoood
Copy link

ilteoood commented Dec 10, 2022

@Keyacom can you give me more detail? I could help to solve that!

@pc-erin
Copy link
Author

pc-erin commented Dec 10, 2022

It might be as simple as changing this line to: "vite": "2.x || 3.x || 4.x"

There might be API differences that matter though, in which case we might need to go through the migration guides for Vite and Rollup.

@C-Ezra-M
Copy link

The CLI excerpt from npm i --save-dev sass is this (happens presumably with any package):

CLI excerpt

In text form:

PS C:\Users\Keyacom\coding\fire-visualize> npm i --save-dev sass
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @preact/preset-vite@2.4.0
npm ERR! Found: vite@4.0.0
npm ERR! node_modules/vite
npm ERR!   peer vite@">=2.0.0-beta.3" from @prefresh/vite@2.2.9
npm ERR!   node_modules/@prefresh/vite
npm ERR!     @prefresh/vite@"^2.2.8" from @preact/preset-vite@2.4.0
npm ERR!     node_modules/@preact/preset-vite
npm ERR!       dev @preact/preset-vite@"^2.4.0" from the root project
npm ERR!   dev vite@"^4.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"2.x || 3.x" from @preact/preset-vite@2.4.0
npm ERR! node_modules/@preact/preset-vite
npm ERR!   dev @preact/preset-vite@"^2.4.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vite@3.2.5
npm ERR! node_modules/vite
npm ERR!   peer vite@"2.x || 3.x" from @preact/preset-vite@2.4.0
npm ERR!   node_modules/@preact/preset-vite
npm ERR!     dev @preact/preset-vite@"^2.4.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Keyacom\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Keyacom\AppData\Local\npm-cache\_logs\2022-12-10T17_20_38_267Z-debug-0.log

To fix this, I set devDependencies.vite in package.json to ^3.2.1 <4.0.0, and it works properly.

@pc-erin
Copy link
Author

pc-erin commented Dec 10, 2022

It works with Yarn because Yarn doesn't install peerDependencies by default. npm needs the -f (force) flag.

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

Successfully merging a pull request may close this issue.

3 participants