sveltejs / vite-plugin-svelte

Svelte plugin for http://vitejs.dev/
MIT License
864 stars 105 forks source link

invalid svelte resolve conflicting results warning on windows #634

Closed olafurw closed 1 year ago

olafurw commented 1 year ago

Describe the bug

Had a warning pop up recently in my build that mentions this.

[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.

The package was flowbite-svelte@0.34.9 so I gave them a bug report. But they mention that they have this defined.

So I setup a repo and I see that I get this warning on the Windows build but not the Linux one. See this job if you open the Build section on each OS.

Their addition of those lines seems fine so I'm wondering if there is a problem in how the warning is given.

Reproduction URL

https://github.com/olafurw/flowbite-svelte-701

Reproduction

Info in the url above.

Logs

Logs in the github action log.

1:34:29 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.

flowbite-svelte@0.34.9

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

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 5.38 GB / 31.73 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (112.0.1722.58)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.1 => 2.0.1
    @sveltejs/kit: ^1.15.8 => 1.15.8
    svelte: ^3.58.0 => 3.58.0
    vite: ^4.3.1 => 4.3.1
dominikg commented 1 year ago

can you try to run it with DEBUG=vite:vite-plugin-svelte npm run dev, it should log the resolve difference that caused this warning to appear then https://github.com/sveltejs/vite-plugin-svelte/blob/2c863276d98d26665f7523fc63a87c9d3bc49abc/packages/vite-plugin-svelte/src/index.ts#L199

The debug log outputs a lot, you might have to grep for it, sorry.

dominikg commented 1 year ago

The issue is caused by backslashes vs slashes. :see_no_evil:

  vite:vite-plugin-svelte resolve difference for flowbite-svelte@0.34.9 flowbite-svelte - svelte: "C:\Users\IEUser\dev\flowbite-svelte-701\node_modules\.pnpm\flowbite-svelte@0.34.9_@popperjs+core@2.11.7_classnames@2.3.2_flowbite@1.6.5_svelte@3.58.0\node_modules\flowbite-svelte\dist\index.js", vite: "C:/Users/IEUser/dev/flowbite-svelte-701/node_modules/.pnpm/flowbite-svelte@0.34.9_@popperjs+core@2.11.7_classnames@2.3.2_flowbite@1.6.5_svelte@3.58.0/node_modules/flowbite-svelte/dist/index.js"
dominikg commented 1 year ago

fixed in 2.1.1, thanks for the report.

olafurw commented 1 year ago

Thanks for the rapid reply. Much appreciated.