Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong missing-declaration warning when using let'ed variable on same node #6009

Closed
dummdidumm opened this issue Feb 21, 2021 · 2 comments · Fixed by #9075
Closed

Wrong missing-declaration warning when using let'ed variable on same node #6009

dummdidumm opened this issue Feb 21, 2021 · 2 comments · Fixed by #9075

Comments

@dummdidumm
Copy link
Member

Describe the bug
Wrong svelte(missing-declaration) warning when using a variable on the same slot node where it was instantiated via a let:X statement but using it before that instantiation.

To Reproduce
This code

<script>
	import Bla from './Bla.svelte';
</script>

<Bla>
	<div slot="foo" class:bar let:bar>.</div>
</Bla>

produces a wrong svelte(missing-declaration) warning for bar. If I put class:bar behind let:bar, the error goes away. Code compiles just fine in both cases.

Expected behavior
No warning.

Information about your Svelte project:
Any browser, any system, Svelte 3.32.3

Severity
Inconvenient, an easy workaround exists

Additional context
Originally reported by @brunnerh in sveltejs/language-tools#817 (comment)

@stale
Copy link

stale bot commented Jun 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 27, 2021
@ngtr6788
Copy link
Contributor

ngtr6788 commented Aug 5, 2023

Seems like this issue is already fixed in the current version: https://svelte.dev/repl/fff8141cb1a84a0787a9ec16a5896029?version=4.1.2

ngtr6788 added a commit to ngtr6788/svelte that referenced this issue Aug 5, 2023
dummdidumm pushed a commit that referenced this issue Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants