svelte-headlessui icon indicating copy to clipboard operation
svelte-headlessui copied to clipboard

warning when using sveltekit v2: The following packages have a svelte field in their package.json but no exports condition for svelte.

Open thenbe opened this issue 1 year ago • 2 comments

Describe the bug Using this package with sveltekit v2 shows a warning during vite dev or vite build:

8:42:57 PM [vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

@rgossiaux/[email protected]

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.

Library version @rgossiaux/svelte-headlessui: 2.0.0

thenbe avatar Dec 14 '23 17:12 thenbe

Seeing this in my build as well after upgrading. Looks easily fixible by

https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition

// package.json
  "files": ["dist"],
  "svelte": "dist/index.js",
+ "exports": {
+   ".": {
+     "svelte": "./dist/index.js"
+   }
  }

msdrigg avatar Dec 18 '23 14:12 msdrigg