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
The on:resize part is marked as not-assignable by TS due to (supposedly?) missing property onresize on used type for that expression:
Type '{ onresize: () => void; }' is not assignable to type 'HTMLProps<Window> & SvelteWindowProps'.
Property 'onresize' does not exist on type 'HTMLProps<Window> & SvelteWindowProps'.ts(2322)
To Reproduce
Steps to reproduce the behavior:
Setup new svelte / TS project as per instructions:
npx degit sveltejs/template svelte-typescript-app
cd svelte-typescript-app
node scripts/setupTypeScript.js
Open project in VS Code with 'Svelte for VS Code' extension installed and enabled
Edit App.svelte to include <svelte:window on:resize={() => console.log('resize')} />
Watch a red squiggly line appearing underneath with above mentioned error
Expected behavior
No error is appearing. The resize handler is accepted just as it is.
Screenshots
System (please complete the following information):
OS: Linux (elementary OS based on Ubuntu 18.04)
IDE: VSCode
Plugin/Package: "Svelte for VSCode", svelte-language-server, probably even type information in Svelte itself
Additional context
First appeared to me while tinkering with Typescript support in an existing Svelte project, reproduced in clean Svelte / TS project as described above.
The text was updated successfully, but these errors were encountered:
Describe the bug
Given the following Svelte component written in TypeScript:
The
on:resize
part is marked as not-assignable by TS due to (supposedly?) missing propertyonresize
on used type for that expression:To Reproduce
Steps to reproduce the behavior:
App.svelte
to include<svelte:window on:resize={() => console.log('resize')} />
Expected behavior
No error is appearing. The resize handler is accepted just as it is.
Screenshots
System (please complete the following information):
svelte-language-server
, probably even type information in Svelte itselfAdditional context
First appeared to me while tinkering with Typescript support in an existing Svelte project, reproduced in clean Svelte / TS project as described above.
The text was updated successfully, but these errors were encountered: