Skip to content

Issue with deconstructed object types on versions >= 4.1.2 #2659

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

Closed
fell-lucas opened this issue Jan 9, 2025 · 1 comment
Closed

Issue with deconstructed object types on versions >= 4.1.2 #2659

fell-lucas opened this issue Jan 9, 2025 · 1 comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@fell-lucas
Copy link

fell-lucas commented Jan 9, 2025

Describe the bug

For some reason, in versions >= 4.1.2 we're receiving Cannot find name TypeScript errors when referencing the types of deconstructed object attributes.

Reproduction

  1. Reference a type from an attribute of a deconstructed MeltUI object
  2. Upgrade from 4.1.1 to 4.1.2

Here is a reproducible StackBlitz: https://stackblitz.com/edit/vitejs-vite-6bxyet7n?file=src%2Flib%2FCounter.svelte
Just run npm run check with different svelte-check versions.

Expected behaviour

Should not error

System Info

  • OS: MacOS
  • IDE: VSCode

Which package is the issue about?

svelte-check

Additional Information, eg. Screenshots

Reproducible example using the MeltUI library:

Kapture.2025-01-09.at.16.46.45.mp4

svelte-check output:

Kapture.2025-01-09.at.16.45.01.mp4

While in version 4.1.1, the type is resolved correctly and no errors are shown:

image
@fell-lucas fell-lucas added the bug Something isn't working label Jan 9, 2025
@jhwz
Copy link

jhwz commented Jan 9, 2025

I'm also seeing this, a minimal reproduction in our project is:

<script lang="ts">
	type Props = {
		prop: string;
	};
	let { prop }: Props = $props();
	type Test = typeof prop; // error here
</script>

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

3 participants