tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
485 stars 38 forks source link

"Unresolved variable or type" when using script with context="module" #84

Closed darrenmothersele closed 4 years ago

darrenmothersele commented 5 years ago

I get an error "Unresolved variable or type videoElem" with the following component. The error appears in the IDE, but does not break the Svelte build.

<video muted playsinline bind:this={videoElem}></video>

<script context="module">
    // Something happens here at module context, not for each component
</script>

<script>
    let videoElem;
</script>

If I move the variable declaration to the module context, or swap the order of the script blocks, then the error does not appear. Perhaps the plugin is only looking within the first script block within a component?

tomblachut commented 5 years ago

Perhaps the plugin is only looking within the first script block within a component?

Yes it is :) Script tags with module context aren't supported yet, sorry.

darrenmothersele commented 5 years ago

Thanks!

darrenmothersele commented 4 years ago

Will you be rolling a new release that includes this fix? Thanks!

tomblachut commented 4 years ago

Yep you can grap it here before it lands in JB marketplace https://github.com/tomblachut/svelte-intellij/releases/tag/v0.12.0