Skip to content

Missing Exports Condition Warning in Sveltekit #161

@fractalmandala

Description

@fractalmandala

Using this library in Sveltekit is showing a missing exports condition warning:

The following packages have a svelte field in their package.json but no exports condition for svelte.
svelte-carousel@1.0.25
Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.

At the link:

If you see a warning logged for this when using a Svelte library, please tell the library maintainers.

Using the svelte field in package.json to point at .svelte source files is deprecated and you must use a svelte export condition. vite-plugin-svelte 3 still resolves it as a fallback, but in a future major release this is going to be removed and without exports condition resolving the library is going to fail.

Example:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions