rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.25k stars 175 forks source link

unknown file extension '.svelte' #645

Closed happysalada closed 5 months ago

happysalada commented 7 months ago

with all the latest version of packages (sveltekit 1.27.4, vite-svelte-plugin 2.5.2) I'm getting this error when trying to import svelte-select using npm tooling (node js 21.1.1 and the accompanying npm). following https://kit.svelte.dev/docs/packaging (it also looks like the package.json field in exports is not needed anymore). here is what I had to do to make this work. in the "exports" field of the bundled package.json, I had to replace the "." entry

    ".": {
      "svelte": "./index.js",
      "types": "./index.d.ts"
    },

I wanted to contribute it to this repo, but I couldn't find the package.json that ends up in the bundle.

I hope this helps someone else. otherwise I'm happy to give more details if needed.

for more context this error is generated in dev, but not when running the build script for adapter-node.

happysalada commented 7 months ago

@rob-balfre I would be happy to contribute on this issue, but I couldn't find the resulting package.json generated for the package. If you where it gets generated, I would gladly makke a PR. Thank you again for the package!