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

@ai-sdk/svelte - beforeUpdate(...) cannot be used in runes mode #3454

Open
phenomen opened this issue Nov 1, 2024 · 4 comments
Open

@ai-sdk/svelte - beforeUpdate(...) cannot be used in runes mode #3454

phenomen opened this issue Nov 1, 2024 · 4 comments
Labels
ai/ui bug Something isn't working

Comments

@phenomen
Copy link

phenomen commented Nov 1, 2024

Description

After updating to Svelte 5, I get this error:

Uncaught Svelte error: lifecycle_legacy_only
`beforeUpdate(...)` cannot be used in runes mode

In the log it points to this code somewhere in @ai-sdk/svelte
brave_zjXBUTPpHb

Code example

<script lang="ts">
	import { useCompletion } from "@ai-sdk/svelte";

	const { input, handleSubmit, completion, isLoading } = useCompletion({
		api: "/api/openai/format",
	});

	let output = $derived($completion);
</script>
@lgrammel lgrammel added bug Something isn't working ai/ui labels Nov 4, 2024
@tguelcan
Copy link

tguelcan commented Nov 6, 2024

Any workaround?

@chengwan7
Copy link

Encountered the same issue after upgrading to svelte 5.

@didier
Copy link

didier commented Nov 7, 2024

Yep this is fully broken in Svelte 5. Seems like a high priority issue to fix.

@phenomen
Copy link
Author

phenomen commented Nov 7, 2024

Apparently, the code comes from @ConsoleTVs/sswr which is deprecated/unmaintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/ui bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants