"Can't find packages" error appearing for dependancies we don't have
See original GitHub issueDescription 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
Steps to Reproduce
import { getFirestore } from 'firebase/firestore';
getFirestore();
- Add firebase@9.6.1 to the dependancies
- 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.
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:
- Created 2 years ago
- Reactions:2
- Comments:7
Top GitHub Comments
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.
I too have this issue, hope it can be resolved!