question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any way to move "The following packages did not export their `package.json`" warning to onwarn?

See original GitHub issue

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 use fs 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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

17reactions
caschbrecommented, Sep 5, 2021

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” 😃

3reactions
benmccanncommented, Nov 3, 2022

We will probably remove pkg.svelte which will end up solving this. However, we’ll need to introduce a warning about the upcoming behavior change for a period of time first for packages where that would change how the package is resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"rollup-plugin-svelte" The following packages did not export ...
It's emitted because some modules specify the files they're exporting in package.json using the exports field, but they don't include package.
Read more >
[rollup-plugin-svelte] The following packages did not export ...
[rollup-plugin-svelte] The following packages did not export their `package.json` file so we could not check the "svelte" field.
Read more >
rollup.js
You will only get a default export from CommonJS plugins. You may not be able to import JSON files such as your package.json...
Read more >
Setting Up a JavaScript Build Process using Rollup
We can then initialise a node project by typing the next command and following the instructions: npm init. It will create a package.json...
Read more >
rollup.js
If your package.json file also has a module field, ES-module-aware tools like Rollup and ... In that way, they behave similarly to const...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found