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 compatible version #12

Open
1 task done
nicolas-albert opened this issue Nov 7, 2024 · 4 comments
Open
1 task done

Svelte 5 compatible version #12

nicolas-albert opened this issue Nov 7, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@nicolas-albert
Copy link

Description

I want to include retejs in a Svelte 5 project (installed with npm i --force).
Like in the closed #7 , the SvelteComponent cannot be found.

✘ [ERROR] No matching export in "node_modules/svelte/src/index-client.js" for import "SvelteComponent"

    node_modules/rete-svelte-plugin/svelte/presets/classic/components/ConnectionWrapper.svelte:8:9:
      8 │ import { SvelteComponent, onMount } from "svelte";
        ╵          ~~~~~~~~~~~~~~~

14:31:32 [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/rete-svelte-plugin/svelte/presets/classic/components/ConnectionWrapper.svelte:8:9: ERROR: No matching export in "node_modules/svelte/src/index-client.js" for import "SvelteComponent"

My package.lock reference rete 2.0.5, rete-svelte-plugin 2.0.3 and svelte 5.1.12.

Suggested Solution

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Ni55aN Ni55aN self-assigned this Nov 10, 2024
@Ni55aN Ni55aN added the enhancement New feature or request label Nov 10, 2024
@Ni55aN
Copy link
Member

Ni55aN commented Dec 28, 2024

@nicolas-albert resolved by #13

@oxalica
Copy link

oxalica commented Jan 8, 2025

@nicolas-albert resolved by #13

I'm on rete-svelte-plugin 2.1.0 but it's still failing for me.

✘ [ERROR] No matching export in "node_modules/svelte/src/index-client.js" for import "Component"

    node_modules/rete-svelte-plugin/5/svelte/presets/classic/components/ConnectionWrapper.svelte:8:9:
      8 │ import { Component, onMount } from "svelte";
        ╵          ~~~~~~~~~

and

[vite] (client) error while updating dependencies:
Error: Build failed with 1 error:
node_modules/rete-svelte-plugin/5/svelte/presets/classic/components/ConnectionWrapper.svelte:8:9: ERROR: No matching export in "node_modules/svelte/src/index-client.js" for import "Component"

Patching it to import { type Component } from "svelte"; fixes it.

@Ni55aN
Copy link
Member

Ni55aN commented Jan 8, 2025

@oxalica thanks for reporting. I'll check it

As a workaround you can try these TS options
https://github.com/retejs/rete-kit/blob/main/src/app/stack/svelte/index.ts#L35

@oxalica
Copy link

oxalica commented Jan 9, 2025

@Ni55aN

As a workaround you can try these TS options
https://github.com/retejs/rete-kit/blob/main/src/app/stack/svelte/index.ts#L35

I'm setting these options in tsconfig.app.json in a project created by npm create vite@latest, but it does not seem to work (it's failing with the same error when opening the webpage). I'm mostly copying the basic example to test it, except to use newer dependencies. Note that the example is written for svelte 4 and is not using rete-svelte-plugin/5, so I'm not sure if it's correct to use that code with svelte 5...

Is there any working example using svelte 5 for reference? It seems all examples on retejs.org is based on react or svelte 4. "rete-svelte-plugin/5" is only mentioned once in an incomplete code from "Guides - Renderers - Svelte", and with that code,

I got another error: Okay It turns out I messed up node_modules during patching. It disappears after I repopulate node_modules.

[plugin:vite:import-analysis] Missing "./5" specifier in "rete-svelte-plugin" package

Sorry if I misunderstood anything. I just discovered rete.js recently and wanna give a try on this awesome library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants