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
Using the npx degit sveltejs/template numbers, then making a file 1_File.svelte and editing the main.svelte to:
<scriptlang="ts">
importFilefrom"1_File.svelte"exportlet name:string;
</script>
<main>
<h1>Hello {name}!</h1>
<File></File>
<p>Visit the <ahref="https://svelte.dev/tutorial">Svelte tutorial</a> to learn how to build Svelte apps.</p>
</main>
Works fine in JS mode, but after running node scripts/setupTypeScript.ts then the reference to File gets an error with:
Type definitions are missing for this Svelte Component. It needs a class definition with at least the property '$$prop_def' which should contain a map of input property definitions.
Example:
class ComponentName { $$prop_def: { propertyName: string; } }
'File' cannot be used as a JSX component.
Its instance type 'SvelteComponentDev' is not a valid JSX element.
Property '$$prop_def' is missing in type 'SvelteComponentDev' but required in type 'ElementClass'.ts(2786)
It's very likely that somewhere there's probably an assumption that the filename can be a legal JS identifier. This can cause locks in the LSP (my guess is in file renames) which means things like formatting fail to happen.
Expected behavior
I can use any filename (I was writing a wizard and wanted my components in the order folks see them)
Screenshots
N/A
( Other than this, everything has been smooth sailing so far )
The text was updated successfully, but these errors were encountered:
Your assumption is correct. We assume the filename is a valid class name which the produces invalid code. We need to strip out leading invalid characters.
dummdidumm
pushed a commit
to dummdidumm/language-tools
that referenced
this issue
Oct 16, 2020
Describe the bug
To Reproduce
Steps to reproduce the behavior:
Using the
npx degit sveltejs/template numbers
, then making a file1_File.svelte
and editing the main.svelte to:Works fine in JS mode, but after running
node scripts/setupTypeScript.ts
then the reference to File gets an error with:It's very likely that somewhere there's probably an assumption that the filename can be a legal JS identifier. This can cause locks in the LSP (my guess is in file renames) which means things like formatting fail to happen.
Expected behavior
I can use any filename (I was writing a wizard and wanted my components in the order folks see them)
Screenshots
N/A
( Other than this, everything has been smooth sailing so far )
The text was updated successfully, but these errors were encountered: