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

Svelte 5: svelte_component_invalid_this_value has false positives #12857

Closed
Conduitry opened this issue Aug 15, 2024 · 1 comment · Fixed by #12960
Closed

Svelte 5: svelte_component_invalid_this_value has false positives #12857

Conduitry opened this issue Aug 15, 2024 · 1 comment · Fixed by #12960
Labels
Milestone

Comments

@Conduitry
Copy link
Member

Describe the bug

The svelte_component_invalid_this_value error message detects any attempt at calling something that's not a function while instantiating a <svelte:component> as this error. This was especially confusing for me while I was trying to debug a Svelte 4->5 migration issue, because the <svelte:component> it was referring to lived inside SK's generated root component, but the component selected by the router not being a function was not the issue.

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACo2OwQrCQAxEf2XJpQqlva9V8OJPtB6kTXFhN1l2U0FK_92UgiJevGWGN5mZYXQeM9h2BroFBAvnGKEEecZV5Ad6QdWZp9SvTpP75KKcOurEhchJzIXZjImDKapa72oLFYeOmvpDU7P5tmeNEZIYubt8nDWy1EpoS-DBjQ4HsJImXMr3KGX-HUWT97v9d_nv6-vyAgGRF8_7AAAA

Logs

No response

System Info

n/a

Severity

annoyance

@Conduitry
Copy link
Member Author

I get the error I would expect - exactly what is thrown - when using <Foo/> instead of <svelte:component this={Foo}/> - https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACo2NwQrCMBBEfyXspQqluccgePEnjAdpNxBIsiHZClL6724RFPHibWZndt4CPkRsYC4L5FtCMHAqBXrgR9lMu2NkFN9oruN2sW2sofDRZcchFaqszkTKV0qqG7To4fXUHVy2-tPOVjItStYSTcEHnMBwnXHt33Cp_AvPc4y7_Tfkd_q6PgG0JC184wAAAA==

Is there a reason for the extra handling with <svelte:component>?

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