isaacHagoel / svelte-dnd-action

An action based drag and drop container for Svelte
MIT License
1.67k stars 100 forks source link

11:03:30 PM [vite-plugin-svelte] WARNING: The following packages use a svelte resolve configuration in package.json that has conflicting results and is going to cause problems future. svelte-dnd-action@0.9.43 Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#conflicts-in-svelte-resolve for details. #562

Open vlrevolution opened 1 month ago

vlrevolution commented 1 month ago

Getting a warning: 11:03:30 PM [vite-plugin-svelte] WARNING: The following packages use a svelte resolve configuration in package.json that has conflicting results and is going to cause problems future.

svelte-dnd-action@0.9.43

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#conflicts-in-svelte-resolve for details.

is it fixable?

EliWimmer commented 3 weeks ago

Guessing you're using Svelte 5?

trasherdk commented 2 weeks ago

I get a warning, saying I have a resolve problem.

Can you please read the documentation, and fix my problem?

No, I can't share any configuration or package.json to help narrow the problem down.

isaacHagoel commented 1 week ago

@vlrevolution can you please provide a way to reproduce this error?

Miniontoby commented 3 days ago

I also get this warning.

This particular warning is only present in vite-plugin-svelte@2. So the easiest way to avoid the warning is to upgrade to vite-plugin-svelte@3.

And if you don't have vite-plugin-svelte installed directly, then check if you have @sveltejs/kit installed and update that to version 2.

isaacHagoel commented 3 days ago

Thanks

On Wed, May 29, 2024, 19:39 Miniontoby @.***> wrote:

I also get this warning.

It is because this package still has an svelte key in the root of the package.json:

Using the svelte field in package.json to point at .svelte source files is deprecated and you must use a svelte export condition https://nodejs.org/api/packages.html#conditional-exports. 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.

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

So basically what vite wants you to do is to make use of the exports -> . -> svelte key. And I can see that you have already done that.

They also say you can keep the svelte field in addition to the exports condition for backwards compatibility, however they didn't write an check/if statement to see if you already have the exports condition, so it is basically no problem at the moment, but it is more like a bug at vite...

If you want to get rid of the warning you can remove the svelte field in the root of the package.json file inside the node_modules/svelte-dnd-action/ folder.

Btw if you want to reproduce, just create a new project (the vite version I am using is 4.5.0), add the package (import it also of course) and then run vite build and you will see the warning popping up:

PS C:\MyProjects\MyProject> npm run build

@.*** build vite build

vite v4.5.2 building SSR bundle for production... ✓ 123 modules transformed. 11:22:29 [vite-plugin-svelte] WARNING: The following packages use a svelte resolve configuration in package.json that has conflicting results and is going to cause problems future.

@.***

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#conflicts-in-svelte-resolve for details.

vite v4.5.2 building for production... ✓ 136 modules transformed. 11:22:34 [vite-plugin-svelte] WARNING: The following packages use a svelte resolve configuration in package.json that has conflicting results and is going to cause problems future.

@.***

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#conflicts-in-svelte-resolve for details. .svelte-kit/output/client/_app/version.json 0.03 kB │ gzip: 0.05 kB .svelte-kit/output/client/.vite/manifest.json 6.94 kB │ gzip: 0.96 kB (...)

— Reply to this email directly, view it on GitHub https://github.com/isaacHagoel/svelte-dnd-action/issues/562#issuecomment-2136981593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4OZC56OU7T3AVCGSIMUZLZEWO3HAVCNFSM6AAAAABGRUKGH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZWHE4DCNJZGM . You are receiving this because you commented.Message ID: @.***>

Miniontoby commented 3 days ago

Oke here is some information about the warning:

This particular warning had been added in 510 and then removed again in 747 it is only present in vite-plugin-svelte@2. So the easiest way for you to avoid it is to upgrade to vite-plugin-svelte@3.

Seems like we should just upgrade to vite-plugin-svelte@3 on our own projects/packages!

P.s. if you don't have that installed, then it might be @sveltejs/kit that needs to be updated to version 2!

isaacHagoel commented 17 hours ago

@Miniontoby thanks for investigating this. I am not sure if I need to do something about this or not 😅

Miniontoby commented 17 hours ago

@Miniontoby thanks for investigating this. I am not sure if I need to do something about this or not 😅

Yeah, you don't have to do anything here. People who get this error just need to update their packages!

I will remove my other comments, to avoid more confusion for others, you may also remove the ones that you posted after my initial comment

isaacHagoel commented 17 hours ago

Thanks. Done