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

Eslint throws error when using #each without "as" #15047

Closed
Em1tt opened this issue Jan 17, 2025 · 2 comments
Closed

Eslint throws error when using #each without "as" #15047

Em1tt opened this issue Jan 17, 2025 · 2 comments

Comments

@Em1tt
Copy link

Em1tt commented Jan 17, 2025

Describe the bug

Using [email protected] on a file that contains an #each loop without an item throws the following error:

0:0  error  Parsing error: Cannot read properties of null (reading 'end')

I've been able to reproduce this issue in multiple files across my project, even in GitHub actions.
Adding the as into the #each directive fixes the issue.

Reproduction

Failing code:

{#each Array(10), index}
	<p>{index}</p>
{/each}
  1. run npx eslint .
  2. following error should appear 0:0 error Parsing error: Cannot read properties of null (reading 'end')

Links: Failed GitHub action | Repository | Failing file

Logs

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 16.51 GB / 31.90 GB
  Binaries:
    Node: 20.14.0 - F:\Nodejs\node.EXE
    npm: 10.8.2 - F:\Nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    svelte: ^5.0.0 => 5.19.0

Severity

annoyance

@7nik
Copy link

7nik commented Jan 18, 2025

Wrong repo, and sveltejs/eslint-plugin-svelte#953 is already fixed. So, just update eslint-plugin-svelte.

@paoloricciuti
Copy link
Member

Closing this, thanks for reporting 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants