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

Typescript - Error: Property 'value' does not exist on type 'Option'. Did you mean 'valueOf'? #287

Open
erezarnon opened this issue Apr 8, 2024 · 6 comments
Labels
bug Something isn't working types TypeScript

Comments

@erezarnon
Copy link

erezarnon commented Apr 8, 2024

Started getting this error with 10.3.0. I believe the culprit is 1b04c15, which isn't in the changelog. Was it included intentionally?

@erezarnon erezarnon added the bug Something isn't working label Apr 8, 2024
@janosh
Copy link
Owner

janosh commented Apr 9, 2024

can you provide a repro? either a Svelte REPL or a code snippet? i don't see how 1b04c15 would have caused this

@janosh janosh added the needs repro Needs a reproduction to get more help label Apr 9, 2024
@erezarnon
Copy link
Author

My mistake, the error's gone now. I must've had something inconsistent

@janosh janosh added invalid This doesn't seem right and removed bug Something isn't working labels Apr 10, 2024
@erezarnon
Copy link
Author

erezarnon commented Apr 13, 2024

Actually, the error is still there. He's a minimal example

<MultiSelect
  options={[{value: 'abc', label: 'abc'}]}
  on:add={(event) => {
    // if you want to persist new user entered custom options to a database, perform
    // a fetch request with type POST here using the event.detail.option payload
    console.log(event.detail.option.value)
  }}
/>

@erezarnon erezarnon reopened this Apr 13, 2024
@erezarnon erezarnon changed the title Error: Property 'value' does not exist on type 'Option'. Did you mean 'valueOf'? Typescript - Error: Property 'value' does not exist on type 'Option'. Did you mean 'valueOf'? Apr 13, 2024
@janosh
Copy link
Owner

janosh commented Apr 14, 2024

the error doesn't repro for me. i pasted your snippet into a REPL and tried with versions 10.2.0 and 10.3.0. both work fine.

@erezarnon
Copy link
Author

It's a typescript error. Is there a way to get typescript into that REPL?

@janosh
Copy link
Owner

janosh commented Apr 15, 2024

sorry should have paid more attention to the issue title. the REPL doesn't support TS. but i can repro the type error. not sure what changed, needs some investigation (and better tests for the future)

@janosh janosh added bug Something isn't working types TypeScript and removed invalid This doesn't seem right needs repro Needs a reproduction to get more help labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working types TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants