Closed mbelsky closed 4 years ago
I found a few problems with this issue:
Dependency is required if you're using Firestore APIs, which your code does. Our Firestore support is provided by the @google-cloud/firestore
library. So if your code calls admin.firestore()
, consider that dependency required.
We have declared it as optional because we have seen random installation errors with those dependencies in the past, and in general we don't want the installation of firebase-admin
to fail because of them.
We have declared it as optional because we have seen random installation errors with those dependencies in the past, and in general we don't want the installation of firebase-admin to fail because of them.
This makes no sense. Your package does not work without firestore
and storage
so you need to require these as non optional dependencies. That's what a dependency is.
It's like planning a Bow & Arrow competition in Antartica, but saying that bringing a Bow is optional because some people couldn't get it through airport security in the past. You make us think we don't need the bow.
we have seen random installation errors
I'd rather my deps fail to install and not work, than it successfully install but not work.
Hi,
My app throws
MODULE_NOT_FOUND
if I install project's dependencies without optional packages.[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
git clone https://github.com/mbelsky/triage.git
cd triage && git co firebase-admin-node
triage
directorynpm run repro
: this command installs project's dependencies without optional and runsfirestore.js
.Output:
Relevant Code:
https://github.com/mbelsky/triage/blob/addf8315b754f5657987b4a13ac11def29728131/firestore.js#L1
As I see this happens bcs this line and
@google-cloud/firestore
defined as optional deps.Should the dependency be defined as not optional?