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

The following packages have a svelte field in their package.json but no exports condition for svelte. #156

Open
mrexodia opened this issue Feb 7, 2024 · 1 comment

Comments

@mrexodia
Copy link

mrexodia commented Feb 7, 2024

Description

23:55:01 [vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

[email protected]

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

Steps to check or reproduce

Run npm install in a project with the latest "svelte-grid": "^5.1.2", and "@sveltejs/vite-plugin-svelte": "^3.0.2",.

Potential fix

As usual with deprecation warnings like this the migration path is rather unclear. It looks like you need to change:

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

To a construction like this (or actually you need to have both, since some tools are not compatible with this yet 🤦🏻‍♂️):

{
	"exports": {
		".": {
			"types": "./dist/index.d.ts",
			"svelte": "./dist/index.js"
		}
	}
}
@rjuevesano
Copy link

rjuevesano commented Mar 25, 2024

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

I've added that and no more warning in local. But when running build I got this
image

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

2 participants