withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.94k stars 2.49k forks source link

@astro/solid-js conflicts with vite@5 #11217

Open shishkin opened 5 months ago

shishkin commented 5 months ago

Astro Info

Astro                    v4.10.1
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Conflicting peer dependency with vite@5. solid-devtools depends on outdated solid-start, which requires vite@4 as peer dependency.

What's the expected result?

This should have been a major version increment or compatible change.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-yttbgb?file=package.json

Participation

florian-lefebvre commented 5 months ago

I don't understand what the repro is trying to show. I don't see any error anywhere, solid is not used nor the integration (although deps are added)... Can you give me more details and/or update the repro?

shishkin commented 5 months ago

Ah, sorry. Try npm install. It fails with:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @example/minimal@0.0.1
npm ERR! Found: @astrojs/solid-js@4.2.0
npm ERR! node_modules/@astrojs/solid-js
npm ERR!   @astrojs/solid-js@"4.3.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! @astrojs/solid-js@"4.3.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: vite@4.5.3
npm ERR! node_modules/vite
npm ERR!   peer vite@"^4.4.6" from solid-start@0.3.11
npm ERR!   node_modules/solid-start
npm ERR!     peerOptional solid-start@"^0.3.0" from solid-devtools@0.30.1
npm ERR!     node_modules/solid-devtools
npm ERR!       peerOptional solid-devtools@"^0.30.1" from @astrojs/solid-js@4.3.0
npm ERR!       node_modules/@astrojs/solid-js
npm ERR!         @astrojs/solid-js@"4.3.0" from the root project
npm ERR!     peer solid-start@"*" from solid-start-aws@0.3.11
npm ERR!     node_modules/solid-start-aws
npm ERR!       peerOptional solid-start-aws@"*" from solid-start@0.3.11
npm ERR!     7 more (solid-start-cloudflare-pages, ...)
florian-lefebvre commented 5 months ago

Works with npm install --legacy-peer-deps but I'm going to open an issue upstream

shishkin commented 5 months ago

Thank you!

kuringer commented 2 months ago

I'm facing this issue too, and it's preventing me from using a date picker component in my Astro project with Solid.js. The --legacy-peer-deps workaround doesn't fully resolve the problem.

This is a critical issue blocking effective use of Solid.js with Astro. Are there any updates on a permanent fix?

As a workaround, would it be possible to make solid-devtools an optional dependency?

florian-lefebvre commented 2 months ago

The peer dependency is already optional (https://github.com/withastro/astro/blob/main/packages/integrations/solid/package.json#L50-L54). I can't look into it before Sept 30th, but if you want a fix to land I think the fastest way is to submit a PR to the devtools directly. Can you also provide a reproduction showing the workaround does not work?