-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Open
Description
Describe the bug
If a component throws while being mounted, that would normally be fine because the developer could fix the code and Svelte would remount the component using HMR. But now, even without having async enabled, HMR fails to remount the component. I've bisected this down to #15844. And found a potential fix which I've made a PR for.
Reproduction
The following reproductions are the same except for the version of Svelte and have a line of code that can be toggled on or off to have the component throw when it mounts.
latest (5.50.1): https://www.sveltelab.dev/32149g118o5egv7
pre-async (5.35.7): https://www.sveltelab.dev/3032460y2gelaoq
Reproduction steps:
- Mount a component that has been compiled using the
hmrcompiler option. - Hot reload the component but have the component throw an exception on mount.
- Hot reload the component but without an exception during mount.
(this excludes the playground since it doesn't use hmr: true)
Logs
System Info
n/aSeverity
annoyance
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels