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.

"Can't find packages" error appearing for dependancies we don't have

See original GitHub issue

Description of Bug

Sometime between August 25th and December 23rd, the dependency resolution for plain Javascript projects changed.

For previously-working projects, and for new ones that import the Firebase libraries, it’s now throwing an error Can't find packages: url tls http2 net dns zlib http events.

However, (1) none of those packages are used in the code, (2) they don’t seem to be imported as dependancies though the package.json and (3) code compiled locally does not throw any errors about missing dependancies. Furthermore, since zlib doesn’t work on stackblitz (it gets Import error, can't find file: ./zlib_bindings), installing those packages doesn’t help.

It appears that stackblitz is over-searching for dependancies inside npm packages, and erroring out even if those code paths never get called.

https://stackblitz.com/edit/firebase-gtk-web-start-pzsfoo?file=index.js image

Steps to Reproduce

  1. Create a blank JS project
  2. Add
import { getFirestore } from 'firebase/firestore';

getFirestore();
  1. Add firebase@9.6.1 to the dependancies
  2. See error

Expected Behavior

There should be no error about missing packages, or the error is allowed to be skipped.

Screenshots/Screencast

If applicable, add screenshots to help explain your problem. image image

Additional Context/Questions gprc-js (imported by firebase/firestore) does reference zlib without importing it. https://github.com/grpc/grpc-node/blob/fe5806171f6033c3988cdaf78ba9fd7940993652/packages/grpc-js/src/compression-filter.ts#L18

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

5reactions
markwhitfeldcommented, Jan 18, 2022

This should be resolved now with the latest release. This bug was unfortunately a side effect of the immense complexity that is node entry-point resolution (now with esm support). Please let us know if there are still any issues. I have tested all links provided above and they now work.

1reaction
AndyEstcommented, Jan 6, 2022

I too have this issue, hope it can be resolved!

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to resolve "Unable to find package" nuget error
First go to in Visual Studio 2019, Tools>Nuget Package Manager>Package Manager Settings>Package Sources and add: https://api.nuget.org/v3/index.
Read more >
npm install not installing dependencies listed in package.json ...
I 'm opening this issue because: npm is crashing. npm is producing an incorrect install. npm is doing something I don't understand.
Read more >
apt - How do I resolve unmet dependencies after adding a PPA?
Apt will attempt to correct broken dependencies. If you manually installed a package that had unmet dependencies, apt-get will install those dependencies, ...
Read more >
Why Can't Python Find My Modules? - Real Python
A common error that new Pythonistas will come across is that the packages they think they've installed are not actually being recognized by...
Read more >
"package does not exist" error, despite autocomplete being ...
I 'm using classes from a project I have as a dependency, the editor seems ... I get a "java: package ... does...
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