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: Motion does not work in kit #9534

Closed
zhihengGet opened this issue Nov 18, 2023 · 3 comments · Fixed by #10715
Closed

Svelte 5: Motion does not work in kit #9534

zhihengGet opened this issue Nov 18, 2023 · 3 comments · Fixed by #10715
Milestone

Comments

@zhihengGet
Copy link

zhihengGet commented Nov 18, 2023

Describe the bug

below code works on svelte 4 and svelte 5

	const progress = tweened(0, {
		duration: 400,
		easing: cubicOut
	});
	progress.set(0.25)

but not sveltekit with svelte 5

svelte 5

Reproduction

included

Logs

No response

System Info

windows

Severity

cant run my code :(

@paoloricciuti
Copy link
Member

This is because the component is run on the server where requestAnimationFrame is not defined...if you try to wrap everything in onMount or $effect it'll work

@rosemarymaker
Copy link

rosemarymaker commented Nov 19, 2023

This is because the component is run on the server where requestAnimationFrame is not defined...if you try to wrap everything in onMount or $effect it'll work

Thanks! Most likely will solve my problem.

but since this is working in sveltekit+svelte4 and it is just initializing the tween value in server side, i don't think it should call requestAnimationFrame

I think it is still a bug.

@benmccann
Copy link
Member

Adding this to the 5.0 milestone for the team to take a look at. At the very least we'd need to mention it in the breaking changes section and migration guide

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 a pull request may close this issue.

4 participants