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
I ran into this because NextJS has enabled SWC to compress JS and since that time my Svelte based library can no longer be used with NextJS unless NextJS is configured to use Terser as JS compressor.
Describe the bug
I don't know wether this problem originates in Svelte or in SWC, I lean towards SWC but will still post it here just to be sure.
When I enable
compress
in the.swcrc
config and then compress a Svelte built target the resulting file will throw an error when loaded in a browser.I've set up a repository here: https://github.com/rikschennink/swc-svelte-problem
I ran into this because NextJS has enabled SWC to compress JS and since that time my Svelte based library can no longer be used with NextJS unless NextJS is configured to use Terser as JS compressor.
Reproduction
https://github.com/rikschennink/swc-svelte-problem
Logs
This error is thrown because
current_component.$$
(Svelte specific) is somehow missing.We can circumvent this by passing
context: []
to the App constructor but now the error will be thrown on the App child component.System Info
Severity
This is not stopping me from upgrading, not stopping me from using svelte, but it's a lot more than an annoyance 😅
The text was updated successfully, but these errors were encountered: