isaacHagoel / svelte-dnd-action

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

svelte-dnd-action uses a svelte resolve configuration in package.json that has conflicting results #536

Open damnmicrowave opened 4 months ago

damnmicrowave commented 4 months ago

I am getting this warning:

[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 in the future.

svelte-dnd-action@0.9.38

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

Trying to look through vite debug logs, found this:

vite:vite-plugin-svelte resolve difference for svelte-dnd-action@0.9.38 svelte-dnd-action - svelte: "<my project path>/node_modules/svelte-dnd-action/src/index.js", vite: "<my project path>/node_modules/svelte-dnd-action/dist/index.mjs"

Vite version: 4.5.1 Svelte-kit version: 1.30.3

isaacHagoel commented 4 months ago

does it help if you change main in package.json (of the lib, you can do it inside your node modules) to point to src instead of dist (like the "svelte" entry)?

On Fri, Jan 5, 2024 at 9:24 PM damnmicrowave @.***> wrote:

I am getting this warning:

[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 in the future.

@.***

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

Trying to look through vite debug logs, found this:

vite:vite-plugin-svelte resolve difference for @.*** svelte-dnd-action - svelte: "/node_modules/svelte-dnd-action/src/index.js", vite: "/node_modules/svelte-dnd-action/dist/index.mjs"

Vite version: 4.5.1 Svelte-kit version: 1.30.3

— Reply to this email directly, view it on GitHub https://github.com/isaacHagoel/svelte-dnd-action/issues/536, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4OZC2OGLRME4EWGFWLNXLYM7IHHAVCNFSM6AAAAABBOG52PCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA3DOMBZGQZTGNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

poppa commented 4 months ago

It seems the "svelte" property in the root of package.json should be removed alltogether. It seems sufficient having it only in the exports property.

    "types": "dist/index.d.ts",
    "svelte": "dist/index.js",           <-- Scrap this
    "exports": {
        ".": {
            "import": {
                "types": "./dist/index.d.ts",
                "default": "./dist/index.mjs"
            },
            "require": {
                "types": "./dist/index.d.ts",
                "default": "./dist/index.js"
            },
            "svelte": "./src/index.js"             <-- This seems enough
        }
    },
isaacHagoel commented 4 months ago

would that be backwards compatible though (not having it)? i can play with it when i have some time, maybe next week or open to PRs if someone wants to fix it

On Thu, Jan 25, 2024 at 8:59 PM Pontus Östlund @.***> wrote:

It seems the "svelte" property in the root of package.json should be removed alltogether. It seems sufficient having it only in the exports property.

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