-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Resolve peer dependency problem in the integration packages (SolidJS, Vue, Svelte, React) #12481
Conversation
🦋 Changeset detectedLatest commit: d8a7f5d The changes in this PR will be included in the next version bump. 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 |
What if we moved |
@ematipico It could be another solution, but in this case it would mean that users will still need to manually install vite in their project to satisfy the peer dependency, which can lead to confusion if they aren't familiar with managing peer dependencies. This could reintroduce the original issue. |
In this case, no, because Astro installs I believe we are hitting a specific issue of Yarn 🤔 |
@ematipico Indeed, it seems to be related to the the way Yarn PnP operates. It is possible that the |
Yeah if it's a peer dep, the user has to install This issue is a little tricky because it's not only affecting solid. svelte, vue, etc are also affected. It worked with pnpm because it hoists packages by default (more like private hoisting than a public one, which is what npm is doing). I guess the right thing to do given what we have is to put |
@bluwy Yes, I think so as well. I'm happy to adjust the PR accordingly! 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only concern with this is potential Vite version mismatches, but hopefully the package manager is smart enough to dedupe it.
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
@bluwy @ematipico Seems like one of the test jobs timed out. The time has exceeded 25 minutes. |
Changes
Moved
vite
from devDependencies to the dependencies of@astrojs/solid-js
in itspackage.json
.Before
Yarn in PnP mode produces the following error :
After
The problem is resolved. Astro works fine.
Closes #12460.
Description
This PR addresses an issue (#12460) where
@astrojs/solid-js
does not declarevite
as a dependency in itspackage.json
. As a result, users encounter a peer dependency error when using this integration, particularly becausevite-plugin-solid
relies onvite
but cannot find it unless explicitly provided by the consuming project.While
astro
itself includesvite
as a dependency, peer dependencies cannot rely on transitive dependencies. This causes issues when configuring the SolidJS integration in theastro.config.js
, as@astrojs/solid-js
is unable to resolvevite
.By adding
vite
as a dependency of@astrojs/solid-js
, this PR ensures :Testing
Tested locally with Yarn's
packageExtenstions
.Docs
Not sure if docs should be updated or not.
/cc @withastro/maintainers-docs for feedback!