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

Two-way binding to let: var throws compile-time exception #2301

Closed
Conduitry opened this issue Mar 23, 2019 · 1 comment · Fixed by #2408
Closed

Two-way binding to let: var throws compile-time exception #2301

Conduitry opened this issue Mar 23, 2019 · 1 comment · Fixed by #2408
Labels
Milestone

Comments

@Conduitry
Copy link
Member

<script>
	let Foo;
</script>

<Foo let:bar>
	<input bind:value={bar}>
</Foo>

Throws a compile-time exception, attempting to access a property of something that's undefined.

I haven't put much thought into this, but it seems like two-way binding with something from let: might be difficult or impossible, in which case we should just have a better error here.

@Conduitry Conduitry added the bug label Mar 23, 2019
@Conduitry Conduitry added this to the 3.0 milestone Mar 23, 2019
@Rich-Harris
Copy link
Member

Yeah, I'm gonna go with 'difficult'. I'm sure it's not impossible, but my sense is that it would require some book-keeping that would usually go unused, so I vote for a better error.

Rich-Harris added a commit that referenced this issue Apr 13, 2019
better error for bindings to let: values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants