Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Feiyang1 opened this issue Feb 17, 2021 · 0 comments · Fixed by #4490
Closed

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

Feiyang1 opened this issue Feb 17, 2021 · 0 comments · Fixed by #4490

Comments

@Feiyang1
Copy link
Member

[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));
@thebrianchen thebrianchen self-assigned this Feb 17, 2021
@firebase firebase locked and limited conversation to collaborators Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants