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

Temporary patch to get past "'Cannot use export let in runes mode β€” use $props() instead'" error when using Svelte in strict runes mode #247

Open
vijay8i opened this issue Jan 1, 2025 · 1 comment

Comments

@vijay8i
Copy link

vijay8i commented Jan 1, 2025

Hi! πŸ‘‹

I understand that you are in the process of supporting Svelte 5 natively and I appreciate it. My project uses Svelte 5 in strict runes mode and trying to use layercake results in the following error:

 'Cannot use `export let` in runes mode β€” use `$props()` instead'

FWIW, I am including this patch that let's me get past the error; and I think might benefit others if you could apply it in an interim release before reaching native Svelte 5 support which I can see is NOT an insignificant amount of work. Please disregard if this is not worth your time.

Here is the diff that solved my problem:

diff --git a/node_modules/layercake/dist/LayerCake.svelte b/node_modules/layercake/dist/LayerCake.svelte
index a7b2dfb..205fe7e 100644
--- a/node_modules/layercake/dist/LayerCake.svelte
+++ b/node_modules/layercake/dist/LayerCake.svelte
@@ -1,3 +1,4 @@
+<svelte:options runes={false} />
 <!--
 	@component
 	Layer Cake component
diff --git a/node_modules/layercake/dist/layouts/Canvas.svelte b/node_modules/layercake/dist/layouts/Canvas.svelte
index be513bd..1c094d6 100644
--- a/node_modules/layercake/dist/layouts/Canvas.svelte
+++ b/node_modules/layercake/dist/layouts/Canvas.svelte
@@ -1,3 +1,4 @@
+<svelte:options runes={false} />
 <!--
 	@component
 	Canvas layout component
diff --git a/node_modules/layercake/dist/layouts/Html.svelte b/node_modules/layercake/dist/layouts/Html.svelte
index 9fd42c9..1e2e94f 100644
--- a/node_modules/layercake/dist/layouts/Html.svelte
+++ b/node_modules/layercake/dist/layouts/Html.svelte
@@ -1,3 +1,4 @@
+<svelte:options runes={false} />
 <!--
 	@component
 	HTML layout component
diff --git a/node_modules/layercake/dist/layouts/ScaledSvg.svelte b/node_modules/layercake/dist/layouts/ScaledSvg.svelte
index 9051006..f4eaad5 100644
--- a/node_modules/layercake/dist/layouts/ScaledSvg.svelte
+++ b/node_modules/layercake/dist/layouts/ScaledSvg.svelte
@@ -1,3 +1,4 @@
+<svelte:options runes={false} />
 <!--
 	@component
 	Scaled SVG layout component
diff --git a/node_modules/layercake/dist/layouts/Svg.svelte b/node_modules/layercake/dist/layouts/Svg.svelte
index 055c877..429f5ac 100644
--- a/node_modules/layercake/dist/layouts/Svg.svelte
+++ b/node_modules/layercake/dist/layouts/Svg.svelte
@@ -1,3 +1,4 @@
+<svelte:options runes={false} />
 <!--
 	@component
 	SVG layout component
diff --git a/node_modules/layercake/dist/layouts/Webgl.svelte b/node_modules/layercake/dist/layouts/Webgl.svelte
index a5eef61..641c6bf 100644
--- a/node_modules/layercake/dist/layouts/Webgl.svelte
+++ b/node_modules/layercake/dist/layouts/Webgl.svelte
@@ -1,3 +1,4 @@
+<svelte:options runes={false} />
 <!--
 	@component
 	WebGL layout component
@vijay8i vijay8i changed the title Temporary patch to get past "'Cannot use export let in runes mode β€” use $props() instead'" error when using Svelte in strict $rune mode Temporary patch to get past "'Cannot use export let in runes mode β€” use $props() instead'" error when using Svelte in strict runes mode Jan 1, 2025
@mhkeller
Copy link
Owner

mhkeller commented Jan 2, 2025

Hi @vijay8i, I've been following the discussion in techniq/layerchart#159 (comment). I agree with the sentiment over there that I don't want to drop support for people using Svelte 4. I don't have a svelte 4 project handy to test on but if you could demonstrate with a repro that it would work fine, that would be great.

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

No branches or pull requests

2 participants