Closed afif-nass closed 5 months ago
I get this warning as well. But I checked the package.json. and it was actually already fixed. The doc page you linked also mentions to be ably to mention every single .svelte file individually. and this is what this repo does.
My local package.json of this dependency looks like this:
{
// ...
"exports": {
"./package.json": "./package.json",
"./ArrowDown.svelte": "./ArrowDown.svelte",
"./ArrowUp.svelte": "./ArrowUp.svelte",
"./BarLoader.svelte": "./BarLoader.svelte",
"./Chasing.svelte": "./Chasing.svelte",
"./Circle.svelte": "./Circle.svelte",
"./Circle2.svelte": "./Circle2.svelte",
"./Circle3.svelte": "./Circle3.svelte",
"./Clock.svelte": "./Clock.svelte",
"./Diamonds.svelte": "./Diamonds.svelte",
"./DoubleBounce.svelte": "./DoubleBounce.svelte",
"./Firework.svelte": "./Firework.svelte",
"./GoogleSpin.svelte": "./GoogleSpin.svelte",
".": "./index.js",
"./Jellyfish.svelte": "./Jellyfish.svelte",
"./Jumper.svelte": "./Jumper.svelte",
"./Moon.svelte": "./Moon.svelte",
"./Plane.svelte": "./Plane.svelte",
"./Puff.svelte": "./Puff.svelte",
"./Pulse.svelte": "./Pulse.svelte",
"./Rainbow.svelte": "./Rainbow.svelte",
"./RingLoader.svelte": "./RingLoader.svelte",
"./ScaleOut.svelte": "./ScaleOut.svelte",
"./Shadow.svelte": "./Shadow.svelte",
"./SpinLine.svelte": "./SpinLine.svelte",
"./Square.svelte": "./Square.svelte",
"./Stretch.svelte": "./Stretch.svelte",
"./SyncLoader.svelte": "./SyncLoader.svelte",
"./types/spinner.type": "./types/spinner.type.js",
"./utils": "./utils.js",
"./Wave.svelte": "./Wave.svelte"
},
"svelte": "./index.js"
}
(seems to somehow get genereated, couldnt find this file in this repo. Only in my projects node_modules/svelte-loading-spinners/package.json file.)
I had another dependency with this error as well, and the startup warning message disappeared after adding the new version. But for some reason, here it doesnt disappear. Only when I remove the top-level "svelte"-key, its fine. I guess the script to detect when to show the warning is faulty, and doesnt detect this multi-file export variant.
So in conclusion: This package seems fine and up-to-date. The warning shouldnt be displayed, but doesnt seem to be the fault of this package.
So in my opinion this issue can get closed
The warning resolves when I change this line:
".": "./index.js",
To this:
".": {
"svelte": "./index.js"
},
This seems to be the format suggested in the "missing exports condition" of this article.
I guess that this exports
field was auto-generated by an older svelte-package version.
Fundamentally, we need to upgrade the toolchain, but we will try to prepare a PR to suppress the warning by monkey patch.
I emailed the author to merge the PRs, but received no response.
I published the forked repository to npm as a workaround.
https://npmjs.com/package/@jill64/svelte-loading-spinners https://github.com/jill64/svelte-loading-spinners
npm i @jill64/svelte-loading-spinners
package.json
{
"dependencies": {
- "svetle-loading-spinners": "0.3.4"
+ "@jill64/svelte-loading-spinners": "0.3.6"
}
}
Hey @jill64 I will check the PR and merge. Thank you!
0.3.5 should be published now!
Getting this warning for svelte-loading-spinners@0.3.4:
[vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.
Easy fix