svelte_sidebar icon indicating copy to clipboard operation
svelte_sidebar copied to clipboard

svelte_sidebar does not behave properly with svelte v4 and vite v5

Open AlvaroSanchezDomingo opened this issue 1 year ago • 0 comments

  • vite-plugin-svelte shows a warning when upgrade svelte version to ^4 and vite version to ^5. See warning bellow:

"devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.1", "svelte": "^4.2.18", "vite": "^5.3.2" },


16:46:24 [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.


  • vite-plugin-svelte repository recomend the following:

missing exports condition

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"
    
  • }

  • Some sidebar behaviours like "collapseTree: true" is not working after the mentioned upgrade and I wonder if it is related with the warning above.

AlvaroSanchezDomingo avatar Jul 01 '24 14:07 AlvaroSanchezDomingo