Skip to content

Firestore looks at wrong locations for proto files when running in Node.  #4480

Closed
@Feiyang1

Description

@Feiyang1

[REQUIRED] Describe your environment

  • Browser version: Nodejs
  • Firebase SDK version: 0.900.12
  • Firebase Product: Firestore

[REQUIRED] Describe the problem

Firestore looks at wrong locations for proto files when running in Node.

@firebase/firestore: Firestore (8.2.5): INTERNAL UNHANDLED ERROR:  Error: ENOENT: no such file or directory, open 'node_modules/@firebase/firestore/dist/src/protos/google/firestore/v1/firestore.proto'
    at Object.openSync (node:fs:495:3)
    at Object.readFileSync (node:fs:396:35)
    at fetch (node_modules/protobufjs/src/root.js:172:34)
    at Root.load (node_modules/protobufjs/src/root.js:206:13)
    at Root.loadSync (node_modules/protobufjs/src/root.js:247:17)
    at Object.loadSync (node_modules/@grpc/proto-loader/build/src/index.js:223:29)
    at loadProtos (node_modules/@firebase/firestore/src/platform/node/load_protos.ts:46:29)
    at newConnection (node_modules/@firebase/firestore/src/platform/node/connection.ts:28:18)
    at OnlineComponentProvider.createDatastore (node_modules/@firebase/firestore/src/core/component_provider.ts:367:24)
    at OnlineComponentProvider.<anonymous> (node_modules/@firebase/firestore/src/core/component_provider.ts:335:27)
Error: ENOENT: no such file or directory, open 'node_modules/@firebase/firestore/dist/src/protos/google/firestore/v1/firestore.proto'
    at Object.openSync (node:fs:495:3)
    at Object.readFileSync (node:fs:396:35)
    at fetch (node_modules/protobufjs/src/root.js:172:34)
    at Root.load (node_modules/protobufjs/src/root.js:206:13)
    at Root.loadSync (node_modules/protobufjs/src/root.js:247:17)
    at Object.loadSync (node_modules/@grpc/proto-loader/build/src/index.js:223:29)
    at loadProtos (node_modules/@firebase/firestore/src/platform/node/load_protos.ts:46:29)
    at newConnection (node_modules/@firebase/firestore/src/platform/node/connection.ts:28:18)
    at OnlineComponentProvider.createDatastore (node_modules/@firebase/firestore/src/core/component_provider.ts:367:24)
    at OnlineComponentProvider.<anonymous> (node_modules/@firebase/firestore/src/core/component_provider.ts:335:27)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! start: `ts-node ./src/index.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Steps to reproduce:

Read data from Firestore

Relevant Code:

const firestore = getFirestore(app);
const ref = doc(firestore, 'path/to/doc');

getDoc(ref).then((val) => console.log(val));

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions