Bug: Using the auto-subscription syntax for a store that was defined in the context="module" script yields an error.
See original GitHub issueTake a look at the Test
component in the following REPL:
https://svelte.dev/repl/4859affa8c1c436783a9d9a6d537c903?version=3
A store is created in a context="module"
script tag, and it’s being used with a dollar sign $
prepended to it, in the markup. It works as expected. However, the very same code in VS Code shows an error:
Note that it works and compiles properly, in other words, the compiler gives no errors; so it must be the Svelte VS Code extension that’s the problem, basically it doesn’t properly recognize any store that’s been defined in the context="module"
script, and as a result causing a red squiggly to appear under $count
here.
Also, it’s only when the lang="ts"
attribute is present on the <script>
tag that the red squiggly appears.
I’d appreciate it if this can be fixed soon.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:6 (2 by maintainers)
Top GitHub Comments
Using the auto-subscription syntax for a store that was defined in the context=“module” script should no longer yield an error as of VS Code extension 104.6.0 /
svelte-check
1.2.1Error: Cannot find name '$username'. Did you mean 'username'? (ts)
whenusername
created incontext="module"
.Code:
Version: