withastro / astro

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

Solid js integration only works if its first in the astro.config.mjs list #11300

Closed laurencefass closed 1 week ago

laurencefass commented 1 week ago

Astro Info

Ive installed integrations for react, solid and qwik. 

The order of integrations appears to be brittle. 

This works fine for qwik and react but not solid.

  integrations: [
    qwik(),
    react(),
    solid(),
  ],

this works only for solid and breaks qwik and react.

  integrations: [
    solid(),
    qwik(),
    react(),
  ], 

the latter option results in this error which is not generated when solid() is the first listed integration. i.e. my solid component renders ok provided its first in the list.

Plugin: vite:esbuild
  File: /app/src/components/solid/Counter.solid.tsx
15:26:59 [ERROR] [vite] The requested module 'solid-js/jsx-runtime' does not provide an export named 'jsxs'
  Stack trace:
    at analyzeImportedModDifference (file:///app/node_modules/vite/dist/node/chunks/dep-BcXSligG.js:52490:15)


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

Chrome

### Describe the Bug

see above

### What's the expected result?

the order of integrations should not break individual integrations.

### Link to Minimal Reproducible Example

https://github.com/laurencefass/syntapse-astro/tree/main/src

### Participation

- [ ] I am willing to submit a pull request for this issue.
ematipico commented 1 week ago

I believe that's expected because Astro doesn't know which jsx files should be rendered using React or Solid.

You should use the include option of each render to narrow down the files for renderer.

https://docs.astro.build/en/guides/integrations-guide/react/#combining-multiple-jsx-frameworks