-
Notifications
You must be signed in to change notification settings - Fork 51
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
solid-js is being bundled twice in production and not in dev #112
Comments
I've had to add
To my vite config to fix the issue. I think this should be dedupe by default... |
Thanks @chiefcll 🙏 I lost 1 hour on this... |
Ok I have spent half a day trying to figure out my issue and it seems like maybe this is related! When I am running my unit tests with |
FYI see this thread for the solution to my issue mentioned above: #101 (comment) |
In dev mode solid-js module is being dedup to ensure its only being bundled once. But when you build for production its not and thus solid-js can be bundled twice leading to side effects like createEffect not having a root because there are two solids running.
I think the solution is to always set dedup and optimizeDeps to the libraries you have listed to prevent them from being bundled twice or be able to pass in
dedupe: [...nestedDeps, ...solidPkgsConfig.nestedDeps]
This is related to: solidjs/solid#1843 and is the root cause of that issue.
The text was updated successfully, but these errors were encountered: