svelte icon indicating copy to clipboard operation
svelte copied to clipboard

fix: export add snippet symbol func

Open azat-io opened this issue 1 year ago • 10 comments

Hello!

Astro uses add_snippet_symbol func: https://github.com/withastro/astro/blob/main/packages/integrations/svelte/client-v5.js#L2

When I use the latest version of Svelte 5 with Astro I get an error:

12:19:22 [ERROR] [UnhandledRejection] Astro detected an unhandled rejection. Here's the stack trace:
Error: Build failed with 1 error:
node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]_type_45aq3zregi4esy5helmin3cl6q/node_modules/@astrojs/svelte/client-v5.js:2:9: ERROR: No matching export in "node_modules/.pnpm/[email protected]/node_modules/svelte/src/internal/client/index.js" for import "add_snippet_symbol"
    at failureErrorWithLog (/Users/azat/Developer/eslint-plugin-perfectionist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1651:15)
    at /Users/azat/Developer/eslint-plugin-perfectionist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1059:25
    at /Users/azat/Developer/eslint-plugin-perfectionist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1527:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

This export was removed in this PR: https://github.com/sveltejs/svelte/commit/4365562228870aaa5c7d85cfd27d03d929a5f295

Please bring back the export of this feature so that you can use Svelte 5 with Astro.

Issue in Astro: https://github.com/withastro/astro/issues/11149

azat-io avatar Jun 12 '24 09:06 azat-io

⚠️ No Changeset found

Latest commit: b8eda2b1bb477360c4a12013672258ef4c09aab8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jun 12 '24 09:06 changeset-bot[bot]

@Rich-Harris @Conduitry Hello! Could you please preview this PR? Without this, we cannot use Svelte 5 with Astro. 😢

azat-io avatar Jun 13 '24 14:06 azat-io

We're aware of the issue, but this isn't the solution we plan to go with. We don't want people using private APIs as these are subject to change without warning. We have a rough design for a solution that we think would work for Astro but we haven't had a chance to test it out yet — more soon

Rich-Harris avatar Jun 13 '24 14:06 Rich-Harris

@Rich-Harris It's cool, and it's the right thing to do. Thanks for the explanation. But maybe we should still merge the current PR as a temporary solution? Currently, Astro can't use Svelte 5 at all.

azat-io avatar Jun 13 '24 18:06 azat-io

@Rich-Harris My suggestion:

  • merge this pull request and give the option to use Svelte 5 with Astro
  • create an issue in Svelte repo about this problem with private API usage
  • specify this pull request in Svelte's new issue as the one to be reverted in future

This is a critical issue. Unfortunately, this problem makes it impossible to release our project.

Currently Astro cannot use Svelte 5 at all. Please give us a temporary solution to the problem. 🙏

azat-io avatar Jun 24 '24 15:06 azat-io

As a temporary workaround an older version works with Astro... npm install --save-dev [email protected]

nzoschke avatar Jun 24 '24 23:06 nzoschke

@nzoschke I need one fix that came in v5.0.0-next.153. Unfortunately, your suggestion doesn't suit me at all.

azat-io avatar Jun 24 '24 23:06 azat-io

cc @bluwy i'm not sure if the integration was ever working with Svelte 5 or not. If so can we revert using this symbol?

matthewp avatar Jun 28 '24 18:06 matthewp

cc @bluwy i'm not sure if the integration was ever working with Svelte 5 or not. If so can we revert using this symbol?

I am working on a project using Astro and svelte integration. It works with svelte 5 but breaks after v5.0.0-next.133. I have also been waiting for this to be fixed.

kenedyolisi avatar Jun 28 '24 22:06 kenedyolisi

Broken for me as well. I'm currently using the latest version 5.0.0-next.166.

KameiKojirou avatar Jun 29 '24 21:06 KameiKojirou

Can stealing the symbol be a temporary solution?

7nik avatar Jul 01 '24 21:07 7nik

Closing this in favour of https://github.com/sveltejs/svelte/pull/12409.

trueadm avatar Jul 11 '24 18:07 trueadm