svelte-intellij
svelte-intellij copied to clipboard
Variables created in reactive statements are marked as unresolved
When I create a variable in a reactive statement like so:
let count = 0;
$: doubled = count * 2;
The result is the following:
In both the declaration site and any usage, the reactive variable is marked as unresolved.
I have the same problem in Pycharm Pro 2021.3
A workaround is to split the declaration and assignment:
let count = 0;
let doubled;
$: doubled = count * 2;
A workaround is to split the declaration and assignment:
let count = 0; let doubled; $: doubled = count * 2;
Thanks I was banging my head against the wall with this, until eventually I had to remove the lang="ts"
and fall back to plain JavaScript.
Folks, I tried to reproduce this across versions and reactive declarations always work for me no matter if in JS or TS script. I'll need a reproduction project for this bug, I'm afraid.
Folks, I tried to reproduce this across versions and reactive declarations always work for me no matter if in JS or TS script. I'll need a reproduction project for this bug, I'm afraid.
This usually happens after you shut the IDE completely and reopen it
Folks, I found the root cause, fix will be released soon
Awesome, thank you!
Was there any regression recently? I'm having this issue in PhpStorm in fresh project
Happens inconsistently, some places work ok, some not

I'm actually getting this too with the new SvelteKit changes:
<script lang="ts">
export let data;
$: ({ posts } = data)
// ^^^^^ -> error here, posts cannot be found
</script>
Folks, I'm assuming this is the 2022.2? Maybe something regressed in the core JS code, need to check
Folks, I'm assuming this is the 2022.2? Maybe something regressed in the core JS code, need to check
The same problem now. I use WebStorm 2022.3
Issue still persists in WebStorm 2023.1.2 together with plugin version 231.8770.15
Covered by some other issues and mostly WEB-58397 use the svelte language server