artiebits / svelte-seo

Optimize your website for search engines and social media with meta tags, Open Graph, and JSON-LD.
https://artiebits.com
MIT License
446 stars 24 forks source link

Make compatible with Svelte 5 #86

Closed watzon closed 2 days ago

watzon commented 2 months ago

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):

lubiah commented 2 months ago

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

github-actions[bot] commented 1 week ago

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.