You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a library exports a component that uses an internal store from a .js file, that component loses reactivity unless excluded by Vite in optimizeDeps.
Describe the bug
When a library exports a component that uses an internal store from a .js file, that component loses reactivity unless excluded by Vite in
optimizeDeps
.For example, say this is an
add-numbers
package:and in your App, you use it like so:
$total
will update correctly, however<Total />
does not.If the imports are split up like this:
then it updates as expected. Otherwise, you need to pass the library into
optimizeDeps.exclude
in vite config.Reproduction
https://github.com/mattjennings/svelte-kit-store-bug
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
I wasn't sure where to report this. If either the Svelte or Vite repo seems more appropriate, I can move this there.
The text was updated successfully, but these errors were encountered: