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
<scriptlang="ts">
exportlet one =false;exportlet disabled =false;exportlet two =false;exportlet three ="";exportlet four =false;exportlet fivefive =false;
</script>
<div {disabled}>Hello!</div>
if I use svelte2dts to create it's declaration types it works but I have this error using it:
Argument of type 'string' is not assignable to parameter of type 'never'. ts(2345)
If instead I rename this line:
- export let fivefive = false;+ export let five = false;
it works! It's crazy! I know!
I think svelte2dts is using svelte2tsx for conversion, right?
- clone it
- npm install
- npm run build
- npm link
- cd your svelte ts project
- npm link svslte2tsx-issue-on-never
- use it like below
- open VSCode
- TADA the problem!
Yes, svelte2dts uses svelte2tsx. I have to check why this would make a difference. It should throw a type error in both cases because you don't forward the click event in Test.svelte, on:click will therefore never fire.
I investigated this a little and I really don't know what's causing this. My current guess is that this is some obscure TypeScript bug which occurs when there is a certain amount of props with a certain length.
Describe the bug
I have this component:
if I use
svelte2dts
to create it's declaration types it works but I have this error using it:Argument of type 'string' is not assignable to parameter of type 'never'. ts(2345)
If instead I rename this line:
it works! It's crazy! I know!
I think
svelte2dts
is usingsvelte2tsx
for conversion, right?To Reproduce
Component REPO: https://github.com/frederikhors/svslte2tsx-issue-on-never
Use it like this:
Expected behavior
I do not understand with in the first case this is what I got in VSCode for
on
:and in the second case I get:
System (please complete the following information):
svelte2dts
throughsvelte2tsx
The text was updated successfully, but these errors were encountered: