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

bindable props "is declared but its value is never read" #12118

Closed
lts20050703 opened this issue Jun 21, 2024 · 1 comment
Closed

bindable props "is declared but its value is never read" #12118

lts20050703 opened this issue Jun 21, 2024 · 1 comment

Comments

@lts20050703
Copy link

lts20050703 commented Jun 21, 2024

Describe the bug

I'm using bindable props as a way to share state from the child component to the parent component, which works for all of my projects except one that consistently error "is declared but its value is never read" for some reason. I have tried downgrading svelte and svelte-check to no avail, so any guidance on how to narrow down the issue would be greatly appreciated.

Reproduction

https://git.sr.ht/~lts20050703/wist/tree/main/item/src/lib/client/is_night.svelte

Please note that I haven't been able to narrow it down to make a minimal reproduction so cloning the entire repo (git clone https://git.sr.ht/~lts20050703/wist) is the only way that I can consistently reproduce this bug.

This is the only project that I can consistently reproduce this bug, I have other projects that also copy pasted that is_night.svelte file but I can't get svelte-check to error.

Logs

svelte-check

====================================
Loading svelte-check in workspace: /home/lts20050703/git/wist
Getting Svelte diagnostics...

/home/lts20050703/git/wist/src/lib/client/is_night.svelte:2:6
Error: 'is_night' is declared but its value is never read. (ts)
<script lang="ts">
        let { is_night = $bindable() }: { is_night: boolean } = $props()



====================================
svelte-check found 1 error and 0 warnings in 1 file

System Info

  System:
    OS: Linux 6.5 KDE neon 6.0 6.0
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 11.39 GB / 15.40 GB
    Container: Yes
    Shell: 3.7.1 - /usr/bin/fish
  Binaries:
    Node: 22.3.0 - ~/.local/share/nvm/v22.3.0/bin/node
    Yarn: 1.22.21 - ~/.local/share/nvm/v22.3.0/bin/yarn
    npm: 10.8.1 - ~/.local/share/nvm/v22.3.0/bin/npm
    pnpm: 8.15.3 - ~/.local/share/nvm/v22.3.0/bin/pnpm
    bun: 1.1.10 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 126.1.67.119
  npmPackages:
    svelte: ^5.0.0-next.154 => 5.0.0-next.154

Severity

annoyance

@jasonlyu123
Copy link
Member

Duplicate of sveltejs/language-tools#2268. You can workaround it by using the variable or turning off noUnusedLocals for now.

@jasonlyu123 jasonlyu123 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
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

2 participants