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've seen related issues regarding TypeScript compiler but I couldn't find any related to Babel.
I've successfully worked around my issue but I wonder if this issue is known and if perhaps at least some note to the docs could be added about it.
Basically the problem is that the script and the template parts are preprocessed separately and thus when using @babel/preset-typescript the import like this gets dropped:
importChildCompfrom'./ChildComp.svelte';
Babel doesn't recognize that the ChildComp was actually referenced at the "runtime position" in the original source because that part of the source is not being given to it.
The workaround that I've used is to use this preset-level option onlyRemoveTypeImports: true