Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Getting @firebase/firestore: Firestore (9.6.1): INTERNAL UNHANDLED ERROR in vercel deployment #32527

Closed
cgtysnpr opened this issue Dec 15, 2021 · 6 comments
Labels
please add a complete reproduction The issue lacks information for further investigation

Comments

@cgtysnpr
Copy link

What version of Next.js are you using?

12.0.7

What version of Node.js are you using?

v16.9.1

What browser are you using?

Opera, Chrome

What operating system are you using?

Windows

How are you deploying your application?

Vercel

Describe the Bug

I deployed my project with Vercel. But Im getting this error in my [id].js file.
2021-12-15T06:17:23.492Z 9a841814-7b90-4455-ae7d-2482a27527bb ERROR [2021-12-15T06:17:23.492Z] @firebase/firestore: Firestore (9.6.1): INTERNAL UNHANDLED ERROR: Error: ENOENT: no such file or directory, open '/var/task/node_modules/@firebase/firestore/dist/src/protos/google/firestore/v1/firestore.proto' at Object.openSync (fs.js:462:3) at Object.readFileSync (fs.js:364:35) at fetch (/var/task/node_modules/protobufjs/src/root.js:172:34) at Root.load (/var/task/node_modules/protobufjs/src/root.js:206:13) at Root.loadSync (/var/task/node_modules/protobufjs/src/root.js:247:17) at Object.loadProtosWithOptionsSync (/var/task/node_modules/@grpc/proto-loader/build/src/util.js:66:29) at loadSync (/var/task/node_modules/@grpc/proto-loader/build/src/index.js:194:31) at loadProtos (file:///var/task/node_modules/@firebase/firestore/dist/index.node.mjs:14500:31) at newConnection (file:///var/task/node_modules/@firebase/firestore/dist/index.node.mjs:14522:20) at OnlineComponentProvider.createDatastore (file:///var/task/node_modules/@firebase/firestore/dist/index.node.mjs:18436:28) 2021-12-15T06:17:23.493Z 9a841814-7b90-4455-ae7d-2482a27527bb ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, open '/var/task/node_modules/@firebase/firestore/dist/src/protos/google/firestore/v1/firestore.proto'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, open '/var/task/node_modules/@firebase/firestore/dist/src/protos/google/firestore/v1/firestore.proto'","code":"ENOENT","errno":-2,"syscall":"open","path":"/var/task/node_modules/@firebase/firestore/dist/src/protos/google/firestore/v1/firestore.proto","stack":["Error: ENOENT: no such file or directory, open '/var/task/node_modules/@firebase/firestore/dist/src/protos/google/firestore/v1/firestore.proto'"," at Object.openSync (fs.js:462:3)"," at Object.readFileSync (fs.js:364:35)"," at fetch (/var/task/node_modules/protobufjs/src/root.js:172:34)"," at Root.load (/var/task/node_modules/protobufjs/src/root.js:206:13)"," at Root.loadSync (/var/task/node_modules/protobufjs/src/root.js:247:17)"," at Object.loadProtosWithOptionsSync (/var/task/node_modules/@grpc/proto-loader/build/src/util.js:66:29)"," at loadSync (/var/task/node_modules/@grpc/proto-loader/build/src/index.js:194:31)"," at loadProtos (file:///var/task/node_modules/@firebase/firestore/dist/index.node.mjs:14500:31)"," at newConnection (file:///var/task/node_modules/@firebase/firestore/dist/index.node.mjs:14522:20)"," at OnlineComponentProvider.createDatastore (file:///var/task/node_modules/@firebase/firestore/dist/index.node.mjs:18436:28)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, open '/var/task/node_modules/@firebase/firestore/dist/src/protos/google/firestore/v1/firestore.proto'"," at process.<anonymous> (/var/runtime/index.js:35:15)"," at process.emit (events.js:326:22)"," at processPromiseRejections (internal/process/promises.js:209:33)"," at processTicksAndRejections (internal/process/task_queues.js:98:32)"]} Unknown application error occurred
Im using getServerSideProps in [id].js file so i think im getting that error because of it. But in local dev mode everything works without any issue.
My getServerSideProps codes

export async function getServerSideProps(context){
   
    const info = db.collection("bilgiler").doc(context.query.id);
    
    const emailInfo = await info
        .collection("email")
        .orderBy("timestamp", "asc")
        .get();
    
    const email = emailInfo.docs
        .map((doc) =>({
            id: doc.id,
            ...doc.data(),
    }))
    const sifreInfo = await info
    .collection("sifre")
    .orderBy("timestamp", "asc")
    .get();

const sifre = sifreInfo.docs
    .map((doc) =>({
        id: doc.id,
        ...doc.data(),
}))


    return{
        props:{
            email:JSON.stringify(email),
            sifre:JSON.stringify(sifre)
        }
    }
    
}

Expected Behavior

I just want to learn why Im getting this error and How can I fix it.

To Reproduce

Adsız

@cgtysnpr cgtysnpr added the bug Issue was opened via the bug report template. label Dec 15, 2021
@alfianandinugraha

This comment has been minimized.

@alfianandinugraha
Copy link

I have the same error

I was fixed this error by downgrade the firebase version to "firebase": "9.4.0",

@balazsorban44 balazsorban44 added please add a complete reproduction The issue lacks information for further investigation and removed bug Issue was opened via the bug report template. labels Dec 15, 2021
@cgtysnpr
Copy link
Author

I have the same error

I was fixed this error by downgrade the firebase version to "firebase": "9.4.0",

Didn't work for me.

@jalal246
Copy link

I had the same problem spent almost 6 hours debugging the issue eventually I removed the old firebase version and installed yarn add firebase@9.4.0 it worked. Don't know what's the problem though but it seems with the new version of firebase.

@cgtysnpr
Copy link
Author

I had the same problem spent almost 6 hours debugging the issue eventually I removed the old firebase version and installed yarn add firebase@9.4.0 it worked. Don't know what's the problem though but it seems with the new version of firebase.

when I downgrade to firebase@9.4.0 Im getting error like "app.firestore is not a function" here is my firebase file

import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
const firebaseConfig = {
//
  };

  const app = !firebase.apps.length
  ? firebase.initializeApp(firebaseConfig)
  : firebase.app();
  const db = app.firestore();
  const auth = app.auth();
  const provider = new firebase.auth.OAuthProvider;

  export {db, auth, provider};

@balazsorban44
Copy link
Member

This doesn't sound like Next.js related. Moving to discussions. If you think this is wrong, please open a new bug report with a reproduction we can investigate. 🙏

@vercel vercel locked and limited conversation to collaborators Dec 16, 2021
@balazsorban44 balazsorban44 converted this issue into discussion #32582 Dec 16, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
please add a complete reproduction The issue lacks information for further investigation
Projects
None yet
Development

No branches or pull requests

4 participants