-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prefer svelte exports condition over svelte field for resolving libraries #725
Comments
Hi, I would like to report that you guys should edit the IF statement used to show a warning when a package is still having the On the FAQ it is said that:
However there is a package
However it has the exports condition in combination with the svelte field: P.s. yes the value's aren't exactly the same. One of them starts with |
@Miniontoby please file an issue including a link to a repository with a reproduction. in general i think the exports map of that package could be changed a bit to put "svelte" into the "import" condition, otherwise you might end up resolving it via exports.import.default instead of exports.svelte. (unfortunately in exports maps order is relevant and first matching entry "wins"). so "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"
}
}, should be "exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"svelte": "./src/index.js",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
}
}, note that removing keys from an exports map is a breaking change. vite-plugin-svelte does not validate the right hand side of the exports condition. it only checks if there is a "svelte" key somewhere in the json structure of the exports map. code please also check your package type field, it looks like .js might currently be mistaken as commonjs. |
I might file an issue later this week, but yeah since this is the issue that introduced it, I thought it would fit here.... But yeah the code you linked to is used for showing the The message that I see doesn't seem to appear anywhere here in this repo tho... Nor in the whole sveltejs org (see this search) And btw the svelte-dnd-action is NOT my repo/package. |
Uhmmmm.... I don't even have Oh wait it is in the But @sveltejs/kit doesn't yet use vite-plugin-svelte@3. |
|
Hmm the update didn't show up using However, I am now updated and I do now get that error that you were talking about:
Update: Oh wait, that is a completely different package! |
that one is legit, the package doesn't have one. Please tell the author. For further help please check our discord on https://svelte.dev/chat channel |
Wait, this is strange, cause the original source of this other Well, I removed the fields that were added somehow and it is fixed. Thanks for you help! |
Describe the problem
We want to remove support for svelte field altogether at some point, take gradual steps to ensure existing libraries can update to not hit users with errors.
Describe the proposed solution
Start prefering the exports condition value over svelte field, add a more persistent/pressing warning for libraries that only use svelte field to switch to exports.
In a following major, drop svelte field resolve entirely. (possibly together with adding svelte 5 support)
Alternatives considered
give it more time.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: