dylanblokhuis / svelte-feather-icons

https://www.npmjs.com/package/svelte-feather-icons/
MIT License
136 stars 21 forks source link

Should svelte be a peer dependency? #28

Open ArtskydJ opened 4 weeks ago

ArtskydJ commented 4 weeks ago

Using esbuild and svelte v4, I was getting this message

...

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

    ../../../node_modules/.pnpm/svelte-feather-icons@4.2.0/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/svelte-feather-icons@4.2.0/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/svelte-feather-icons@4.2.0/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/svelte-feather-icons@4.2.0/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/svelte-feather-icons@4.2.0/node_modules/svelte-feather-icons/src/icons/ActivityIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
../../../node_modules/.pnpm/svelte-feather-icons@4.2.0/node_modules/svelte-feather-icons/src/icons/AirplayIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
../../../node_modules/.pnpm/svelte-feather-icons@4.2.0/node_modules/svelte-feather-icons/src/icons/AlertCircleIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
../../../node_modules/.pnpm/svelte-feather-icons@4.2.0/node_modules/svelte-feather-icons/src/icons/AlertOctagonIcon.svelte:14:7: ERROR: Could not resolve "svelte/internal/disclose-version"
../../../node_modules/.pnpm/svelte-feather-icons@4.2.0/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