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

[1.1] Fix dependency issue with Vite 5 #313

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

jessarcher
Copy link
Member

@jessarcher jessarcher commented Dec 3, 2024

This PR fixes the following dependency resolution issue for users of Vite 5 by allowing it to be a peer dependency in the latest version of this plugin.

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: undefined@undefined
npm error Found: vite@5.4.11
npm error node_modules/vite
npm error   dev vite@"^5.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer vite@"^6.0.0" from laravel-vite-plugin@1.1.0
npm error node_modules/laravel-vite-plugin
npm error   dev laravel-vite-plugin@"^1.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Our understanding was that NPM would not attempt to install/upgrade this plugin to v1.1 and instead continue to use v1.0 until the project's Vite dependency was bumped to v6. However, it seems that NPM tries to install the latest versions purely based on the constraints in package.json and then fails if they're incompatible instead of using the latest mutually compatible versions as Composer does.

It would seem that with NPM, the only way to safely drop support for a peer dependency major version is with a major version release, so we've decided to reintroduce support for Vite 5, which matches official Vite plugins like @vitejs/plugin-vue.

Fixes #311
Fixes #312

@jessarcher jessarcher changed the title [1.x] Fix dependency issue with Vite 5 [1.1] Fix dependency issue with Vite 5 Dec 3, 2024
@taylorotwell taylorotwell merged commit 6515574 into 1.x Dec 3, 2024
6 checks passed
@taylorotwell taylorotwell deleted the fix-vite-5-dependency-issue branch December 3, 2024 08:14
@kylemilloy
Copy link

You guys are rockstars. Thanks for the late night fix 💪👁️👄👁️💪

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 this pull request may close these issues.

The update to Version 6 appears to break new Laravel installs. Breaks with vite 5.x
3 participants