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

🐛 BUG: solid adapter breaks react components depending on integrations array order #4033

Closed
1 task
mayank99 opened this issue Jul 23, 2022 · 3 comments
Closed
1 task

Comments

@mayank99
Copy link
Contributor

What version of astro are you using?

1.0.0-beta.73

Are you using an SSR adapter? If so, which one?

none

What package manager are you using?

npm

What operating system are you using?

WIndows

Describe the Bug

If solid() comes before react() in the integrations array in astro.config.ts, then it breaks react components with the following error 🙃

Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
    at Proxy.useState (project\node_modules\react\cjs\react.development.js:1622:21)
    at __vite_ssr_exports__.default (/src/Component.tsx:8:51)
    at Proxy.createComponent (project\node_modules\solid-js\dist\server.cjs:252:15)
    at eval (project/node_modules/@astrojs/solid-js/server.js?v=715ab7fa:27:80)
    at Proxy.renderToString (project\node_modules\solid-js\web\dist\server.cjs:250:86)       
    at renderToStaticMarkup (project/node_modules/@astrojs/solid-js/server.js?v=715ab7fa:27:37)
    at Object.check (project/node_modules/@astrojs/solid-js/server.js?v=715ab7fa:10:19)      
    at Module.renderComponent (/node_modules/astro/dist/runtime/server/index.js:183:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-e3lhnb?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.
@Princesseuh
Copy link
Member

Similar issue, albeit with Preact: #3611

@tony-sull
Copy link
Contributor

Yep, looks like this will be the same bug. Closing this out as a duplicate of #3611 so we can prioritize that one based on it seeming to hit SolidJS + any other JSX framework

@mayank99
Copy link
Contributor Author

mayank99 commented Aug 2, 2022

I'm still having this issue in the RC. Here's an updated repro: https://stackblitz.com/edit/github-fpdu2n

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

No branches or pull requests

3 participants