-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Any way to move "The following packages did not export their package.json
" warning to onwarn?
#181
Comments
PS the package owner is wrong |
If there were a nice way to use |
Thank you for your input. Looking at this from the outside, I don't see any reason why |
I'm torn on this. I've run into the same thing where a package owner wouldn't change their package.json file because some other package is throwing warnings. It's great that this warning is shown, but from a developer experience point-of-view, it gets very annoying after a while. I know the issue is there, but seeing the warning makes me thing I've got some issue in my code... or eventually leads me to ignore the console warnings (because they're always there) and then I miss a real issue. |
At this point I'm looking at something like https://github.com/ds300/patch-package to try and handle the patch locally. What "should" the package.json exports look like to remove the warning? |
@caschbre
I even submitted a PR to the package owner, but it was rejected due to reason given in first comment. I am not going to say who is right or not since I'm just thankful for both party's time and effort in these OSS libraries. However, I just don't see why |
I've tried making the change in a package here, and the MR was closed as well. https://github.com/sveltejs/rollup-plugin-svelte#pkgsvelte
I find it difficult to accept that the vast majority of packages would easily accommodate this request. It is only a question of time before more packages use the relatively new I do understand that removing this error places a burden on svelte component packages. They will need to consult documentation and be aware of best practices. Is there any way we can scan a package's exports for svelte components, before showing this message? |
It's a warning, not an error.
There is lots of incomplete and/or misinformation regarding ESM and
That's exactly what's being done & what the warning is about: "Hey, we weren't allowed to look at X,Y,Z |
@lukeed Regarding the last point, I meant whether the plugin can scan what is actually being exported by the package (without looking at the i.e "Hey, I can see that some svelte components are included, but this package is not letting me get to their uncompiled source code" |
So to @Conduitry's earlier point, the quickest way to achieve that would be Since that's off the table, have to remain with
Wherever/whatever the output file path is determined to be, this plugin would then have to recursively scale that file's directories until it finds the root All that is to say :: it's not impossible, but it's a truck load of filesystem operations for a simple task, which may prove to be tricky to get right in all cases anyway. It's exactly the kinda guesswork that "exports" was meant to solve/replace. |
I'm ok with rollup-plugin-svelte not trying to do more to handle other packages not exporting their package.json. I guess all I would be looking for is some configuration (e.g. in rollup.config.js) where we can list the libraries to skip the warning for. Essentially a way to say "yep, I've seen the warning. Now stop showing it to me for this library" :-) |
Surprisingly I only started to see it now, but it's very annoying. I don't care about this warning. Moreover, why would anyone export Lastly, warnings are usually there for devs to know that they should fix something. |
As expected - 3rd party libraries do not give a damn about adding weird constructs to their code, just to satisfy your warning logger, so can we please be done with it and drop this stupid warning already? |
We will probably remove resolution of |
This was closed by #205 |
Getting the "The following packages did not export their
package.json
" warning importing a package. I requested a PR for that package and owner closed it saying bundlers should usefs
to read the package.json instead.Regardless of the owner being right or not, is there any reason why this one has to be done with console.warn and not part of
onwarn
warnings? All warnings should be suppressible so users can suppress them once they see it and deemed not important.The text was updated successfully, but these errors were encountered: