svelte-seo icon indicating copy to clipboard operation
svelte-seo copied to clipboard

Make compatible with Svelte 5

Open watzon opened this issue 1 year ago • 2 comments

Describe the bug Attempting to use in a Svelte 5 project with runes enabled results in the following error:

✘ [ERROR] node_modules/svelte-seo/index.svelte:3:2 Cannot use `export let` in runes mode — use `$props()` instead [plugin vite-plugin-svelte:optimize-svelte]

    node_modules/svelte-seo/index.svelte:3:2:
      3 │  export let title = undefined;
        ╵   ^

  The plugin "vite-plugin-svelte:optimize-svelte" was triggered by this import

    node_modules/svelte-seo/index.js:1:22:
      1 │ import component from "./index.svelte";
        ╵                       ~~~~~~~~~~~~~~~~

To Reproduce Steps to reproduce the behavior:

  1. Install in a Svelte 5 project
  2. Use as described in docs

Expected behavior It should work.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome

watzon avatar Aug 17 '24 03:08 watzon

Hi @watzon , Is there a way to check the current svelte version with code? I think the solution is to use an if statement and use different code for svelte 5

lubiah avatar Aug 17 '24 10:08 lubiah

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 17 '24 09:10 github-actions[bot]

I'd like to reopen this as Svelte 5 is officially released now.

Shackless avatar Dec 04 '24 15:12 Shackless

@Shackless , I'd take a look at this

lubiah avatar Dec 04 '24 17:12 lubiah

@artiebits , can we re-open this issue, I would like to migrate the project to use $props instead of the let

lubiah avatar Aug 16 '25 22:08 lubiah

Hi folks, I'm running into issues also with Svelte 5. @artiebits would you mind taking a look and merging the PR?

chanmathew avatar Sep 06 '25 14:09 chanmathew

Apologies for the delay, will review it today @chanmathew @lubiah

artiebits avatar Sep 19 '25 10:09 artiebits

New version, 1.7.1, has been published. Please test it and let me know if it doesn’t fix the issue. Thanks everyone!

artiebits avatar Sep 27 '25 09:09 artiebits