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

Accessors aren't typed when using customElements: true #1127

Closed
vultix opened this issue Jul 31, 2021 · 0 comments
Closed

Accessors aren't typed when using customElements: true #1127

vultix opened this issue Jul 31, 2021 · 0 comments
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@vultix
Copy link

vultix commented Jul 31, 2021

Describe the bug
svelte2tsx doesn't type accessors when compiling using customElements: true. Using custom elements automatically enables accessors for all files, so those properties should be typed.

Setting accessors: true in your svelte.config.js file also doesn't work.

To Reproduce
Here's an example project: svelte-bug.zip

If you run npm i and try a svelte-check you should get this error:

Property 'test' does not exist on type 'Lib__SvelteComponent_'

The error goes away if you update line 1 of src/Lib.svelte to this:

<svelte:options tag="test-lib" accessors={true} />

This is a reasonable workaround, but shouldn't be required.

@vultix vultix added the bug Something isn't working label Jul 31, 2021
@jasonlyu123 jasonlyu123 added the Fixed Fixed in master branch. Pending production release. label Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

2 participants