Outdated svelte2tsx
dependency for @sveltejs/package
#12517
Labels
pkg:svelte-package
Issues related to svelte-package
svelte2tsx
dependency for @sveltejs/package
#12517
Describe the bug
Hi there, I've stumbled across an annoying issue using
@sveltejs/package
to generate types for svelte 5 components, related to thesvelte2tsx
semver range. I think this is the best place to post this issue since the change would need to be made in this repo.Because of the way pnpm works, when
@sveltejs/package
updates, it does not update indirect dependencies that already match the semver range. The semver range ofsvelte2tsx
is currently"~0.7.0"
, and hasn't been updated since #11619 (6 months ago).At some point, the version of
svelte2tsx
in the TanStack Query repo got installed as v0.7.1. However, there are numerous new releases since then which have improved svelte 5 compatibility. When packaging svelte 5 components with this version ofsvelte2tsx
, it is unable to generate the correct types (all props areunknown
).I can work around this problem by deleting
pnpm-lock.yaml
, which installs the latestsvelte2tsx
version (v0.7.13) and generates the correct types. However, I wonder if it would be better to keep svelte2tsx's semver range updated within@sveltejs/package
so other library devs don't run into the problem. This could be automatically handled by renovate with the"rangeStrategy": "bump"
option - for reference, this is also used by Astro's renovate config.Reproduction
With
svelte2tsx
v0.7.1 installed as a dependency of@sveltejs/package
, the following componentDemo.svelte
:Generates the following type output:
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: