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
Describe the bug
Yesterday with v101.0.0 I finished migrating my Svelte components library to TS with almost no / no severe (correctly compiling) TS-errors. Today with v101.1.1 (checked: starting with v101.1.0) I get a bunch of ts(2440) (+ a lot of resulting) errors: Import declaration conflicts with local declaration of 'Foo', while everything is still compiling / building correctly as with v101.0.0. I'm not sure though if this is a bug or a feature which was not functioning correctly in v101.0.0.
Running svelte-check reports same errors.
To Reproduce
I'm going to describe as simple as possible how I'm building the mentioned library.
It's a library of Svelte components 'target_lib' wrapping modules of library 'source_lib'. Svelte wrapper-components and their corresponding modules from 'source_lib' have identical names:
// Svelte wrapper-component 'Foo.svelte'<scriptlang="typescript">
import {Foo} from 'source_lib'
</script>// 'target_lib.ts'export{defaultasFoo}from'./components/Foo.svelte'export*from'source_lib'
When building 'target_lib' Rollup is renaming duplicates like this in the 'target_lib.mjs':
Foo from 'source_lib' keep name Foo
Svelte wrapper-Foo-components are being renamed to Foo_1 (+ _1)
This might seem like bad practice but is exactly how I want it to be, it works as intended: Svelte 'target_lib'-'Foo' components override (and utilize) corresponding 'source_lib'-'Foo' components when e.g.
//Test.svelte<script>
import {Foo} from 'target_lib'
</script><Foo/>
Expected behavior
I don't know what to expect, because I don't know if ts(2440) errors are a bug or a feature. Rollup builds o.k. as expected / as before despite the "new" errors.
Actually it feels like correct behavior that these conflicts are being reported, but on the other hand it makes Rollup's ability to manage such cases obsolete and then it feels kind of wrong again. I would just like to get a clear response if this is intended / correct behavior, then I would know if I have to think of another solution / fix / find workaround or wait for an update. Thanks!
System (please complete the following information):
vatro
changed the title
TypeScript Errors ts(2440) with Svelte for VS Code v101.1.1
TypeScript Errors ts(2440) with Svelte for VS Code starting v101.1.0
Jul 8, 2020
This is a result of a change introduced in #285 , there we changed the transformed tsx output to have named default exports, which are the same as the file. Because of this ts will complain in your Foo.svelte that there are two definitions of Foo now.
This is definitely something we did not consider, maybe we should postfix the converted Components with something that is very unlikely to occur in user's code. Something like export default class Foo_SvelteComponent.
dummdidumm
pushed a commit
to dummdidumm/language-tools
that referenced
this issue
Jul 9, 2020
Describe the bug
Yesterday with v101.0.0 I finished migrating my Svelte components library to TS with almost no / no severe (correctly compiling) TS-errors. Today with v101.1.1 (checked: starting with v101.1.0) I get a bunch of ts(2440) (+ a lot of resulting) errors: Import declaration conflicts with local declaration of 'Foo', while everything is still compiling / building correctly as with v101.0.0. I'm not sure though if this is a bug or a feature which was not functioning correctly in v101.0.0.
Running
svelte-check
reports same errors.To Reproduce
I'm going to describe as simple as possible how I'm building the mentioned library.
It's a library of Svelte components 'target_lib' wrapping modules of library 'source_lib'. Svelte wrapper-components and their corresponding modules from 'source_lib' have identical names:
When building 'target_lib' Rollup is renaming duplicates like this in the 'target_lib.mjs':
Foo
from 'source_lib' keep nameFoo
Svelte wrapper-
Foo
-components are being renamed toFoo_1
(+ _1)This might seem like bad practice but is exactly how I want it to be, it works as intended: Svelte 'target_lib'-'Foo' components override (and utilize) corresponding 'source_lib'-'Foo' components when e.g.
Expected behavior
I don't know what to expect, because I don't know if ts(2440) errors are a bug or a feature. Rollup builds o.k. as expected / as before despite the "new" errors.
Actually it feels like correct behavior that these conflicts are being reported, but on the other hand it makes Rollup's ability to manage such cases obsolete and then it feels kind of wrong again. I would just like to get a clear response if this is intended / correct behavior, then I would know if I have to think of another solution / fix / find workaround or wait for an update. Thanks!
System (please complete the following information):
Svelte for VSCode
Thanks!
The text was updated successfully, but these errors were encountered: