Skip to content

Comments

Svelte 5 support#19

Open
ieedan wants to merge 7 commits intolochie:mainfrom
ieedan:svelte
Open

Svelte 5 support#19
ieedan wants to merge 7 commits intolochie:mainfrom
ieedan:svelte

Conversation

@ieedan
Copy link

@ieedan ieedan commented Feb 20, 2026

Currently trying to use this in Svelte 5 doesn't work because of the following error:

Error: Your application, or one of it's dependencies, imported from 'svelte/internal', which was a private module used by Svelte 4 components that no longer exists in Svelte 5.

Since this package is fairly new I can't imagine a whole lot of Svelte 4 users are using it yet so it seems fine to introduce a breaking change to support Svelte 5 instead.

Also updated the svelte-example and usage on the site.

Fixes #18

@vercel
Copy link

vercel bot commented Feb 20, 2026

@ieedan is attempting to deploy a commit to the Lochie's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Feb 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
torph Ready Ready Preview, Comment Feb 22, 2026 10:38pm
torph-svelte-example Ready Ready Preview, Comment Feb 22, 2026 10:38pm
torph-vue-example Ready Ready Preview, Comment Feb 22, 2026 10:38pm

@ieedan
Copy link
Author

ieedan commented Feb 21, 2026

Fixed the props!

@ieedan
Copy link
Author

ieedan commented Feb 21, 2026

My bad forgot to bump vite along with it. Also removed some unnecessary config from the vite.config since we are using the workspace protocol we don't need that.

@lochie
Copy link
Owner

lochie commented Feb 21, 2026

@ieedan is this building locally for you? im seeing this error

Caution

error during build:
[vite]: Rollup failed to resolve import "torph/svelte" from "/vercel/path0/apps/svelte-example/src/App.svelte".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external

@ieedan
Copy link
Author

ieedan commented Feb 21, 2026

Yeah it was building locally

@ieedan
Copy link
Author

ieedan commented Feb 22, 2026

Okay was able to reproduce in my own Vercel deployment I guess that vite config is necessary after all. Weird I have never run into that before.

In any case it should work now!

@jaydenfyi
Copy link
Contributor

jaydenfyi commented Feb 23, 2026

I assumed Svelte 4 was an intentional choice for backwards compatibility, given Svelte 5 can use Svelte 4 components, but not vice-versa. Was that not the case @lochie ?

EDIT: Apologies I skipped past the PR description here 😅 Agree I don't think it really matters all things considered, most libraries are starting to cut over to 5 now.

I'm happy to look into it tomorrow if backwards-compatibility is desired. I'm assuming it's just some weird compilation issue with tsup causing Svelte code being compiled somewhere it shouldn't be.

@lochie
Copy link
Owner

lochie commented Feb 23, 2026

I'm happy to look into it tomorrow if backwards-compatibility is desired. I'm assuming it's just some weird compilation issue with tsup causing Svelte code being compiled somewhere it shouldn't be.

@jaydenfyi i dont personally use svelte so im not aware of the desires of the ecosystem. im happy to roll with whatever you two unanimously are happy with!

@lochie
Copy link
Owner

lochie commented Feb 23, 2026

@ieedan this PR looks good to me. but keen to understand the ideal scenario here re: 4 <> 5 support

@ieedan
Copy link
Author

ieedan commented Feb 23, 2026

Svelte 4 should provide cross compatibility but the reason I raised this PR is that unfortunately at this time does not and Svelte 5 is broken.

Since you can technically use Svelte 4 and 5 together in the same app I don't see any reason to support Svelte 4 at the expense of Svelte 5. Consumers can simply update their Svelte version at any time to use this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Svelte version does not work

3 participants