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

Should svelte be a peer dependency? #28

Open
ArtskydJ opened this issue Oct 31, 2024 · 0 comments
Open

Should svelte be a peer dependency? #28

ArtskydJ opened this issue Oct 31, 2024 · 0 comments

Comments

@ArtskydJ
Copy link

ArtskydJ commented Oct 31, 2024

Using esbuild and svelte v4, I was getting this message

...

✘ [ERROR] Could not resolve "svelte/internal/disclose-version"

    ../../../node_modules/.pnpm/[email protected]/node_modules/svelte-feather-icons/src/icons/SquareIcon.svelte:14:7:
      14 │ import "svelte/internal/disclose-version";
         ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The path "./internal/disclose-version" is not exported by package "svelte":

    ../../../node_modules/.pnpm/[email protected]/node_modules/svelte/package.json:23:13:
      23 │   "exports": {
         ╵              ^

  You can mark the path "svelte/internal/disclose-version" as external to exclude it from the
  bundle, which will remove this error.

✘ [ERROR] Could not resolve "svelte/internal/disclose-version"

    ../../../node_modules/.pnpm/[email protected]/node_modules/svelte-feather-icons/src/icons/DownloadCloudIcon.svelte:14:7:
      14 │ import "svelte/internal/disclose-version";
         ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The path "./internal/disclose-version" is not exported by package "svelte":

    ../../../node_modules/.pnpm/[email protected]/node_modules/svelte/package.json:23:13:
      23 │   "exports": {
         ╵              ^

  You can mark the path "svelte/internal/disclose-version" as external to exclude it from the
  bundle, which will remove this error.

Build failed with 287 errors:
../../../node_modules/.pnpm/[email protected]/node_modules/svelte-feather-icons/src/icons/ActivityIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
../../../node_modules/.pnpm/[email protected]/node_modules/svelte-feather-icons/src/icons/AirplayIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
../../../node_modules/.pnpm/[email protected]/node_modules/svelte-feather-icons/src/icons/AlertCircleIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
../../../node_modules/.pnpm/[email protected]/node_modules/svelte-feather-icons/src/icons/AlertOctagonIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
../../../node_modules/.pnpm/[email protected]/node_modules/svelte-feather-icons/src/icons/AlertTriangleIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
...

And I was able to work around it by adding this to my package.json (I'm using pnpm)

{
	// ...
	"pnpm": {
		"overrides": {
			"svelte-feather-icons>svelte": "^4.0.0"
		}
	}
}

I'm wondering if svelte should be a peer dependency.


There's a decent chance I'm doing something wrong. I don't understand why svelte would be getting imported in the first place.

Works fine in the svelte playground

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

1 participant