Question: why isn't protos.json
loaded with a require
call in Node environment?
#1493
Labels
api: firestore
Issues related to the googleapis/nodejs-firestore API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Hello!
During an attempt to bundle (via esbuild) a Node application using the
firebase-admin
SDK I noticed thatprotos.json
is loaded using arequire
call in a browser environment, but loaded differently in a Node environment, c.f.nodejs-firestore/dev/src/v1/firestore_admin_client.ts
Line 164 in c7d67fb
While I acknowledge that bundling Node applications may not be a use-case you want to support, I was wondering why you made the explicit choice of not using
require
in a Node environment? My suggestion would be to userequire
in all environments, like so:It'd appear that I am not the only one who ran into this issue:
Bundling back-end applications has some benefits (in my case, generate the smallest possible package for services deployed to Cloud Run / Cloud Functions), so if making this small change would enable it it'd be wonderful!
Thanks for your work.
Related threads:
The text was updated successfully, but these errors were encountered: