-
Notifications
You must be signed in to change notification settings - Fork 893
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
[Error] Firebase version compatibility problem in vercel (between 9.2.* -> 9.3.*) #5823
Comments
Hi @YongwoonJang, thanks for reporting this behavior. I tried replicating, but I wasn't able to reproduce the error. I verified that it's working fine for |
Hello thanks for your reply. My build environment is Vercel(Next.js). (Vercel)[Vercel.com] I inspect some change between "v9.2.* and v9.3.*" and there is a change in " firestore > dist > index.node.cjs.js" // __filename and __dirname globals are unavailable in ES modules
// @ts-ignore To avoid using `--module es2020` flag.
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.node.cjs.js', document.baseURI).href)));
const __dirname$1 = path.dirname(__filename$1); but In v3.2.1's index.node.cjs.js above snippet is deleted. and recent update 3.4.1 is below but it makes the same problem // __filename and __dirname globals are unavailable in ES modules
// @ts-ignore To avoid using `--module es2020` flag.
const __filenameInESM = url.fileURLToPath(new (require('url').URL)('file:' + __filename).href);
const __dirnameInESM = path.dirname(__filenameInESM); and I use firebase v9.6 and change firestore version 3.2.0 than issue is resolved. So, I think that this skipped(or changed) snippet makes an error for Vercel framework. Sincerely. |
Fix coming. |
I have this problem too on older versions like 9.1. How can I fix this problem now? |
You will have to upgrade to the new version once it has been released. |
I know. But I would like fix bug now. |
Hey, I am having the same issue, and it only happens when the project is deployed on Vercel, my firebase version is 9.6.1. Is that really a firebase problem or is it a Vercel problem, because if I build & start locally, its working fine. P.S. I have the same error, just generated in a different way, for me it throws the error, when I try to fetch from
I am calling So do I too need to wait for that new version, and is there any place where I can check, what version I am waiting for and when is it supposed to go out? |
+1 on this issue getting the same error as @Darkbound when calling await getDoc in getServerSideProps on Vercel deployment, would appreciate any updates or temporary solutions until new version is released. This is causing huge issues when trying to push features to our production build. |
+1 getting the same error when deployed on both Vercel and Netlify. The production build locally works fine. Can confirm that downgrading to firebase 9.2 fixed the problem and allows it to work properly on both Vercel and Netlify. |
@gholevas I just tried downgrading to 9.2.0 and now I am getting a different kind of error, that __dirname is undefined:
|
I confirm that downgrading down to 9.1.0 works when deployed on vercel. |
I'm looking into this but if anyone who is more knowledgeable about Vercel has a quick answer, it may help: If the fix in @YongwoonJang 's comment above works (adding the conditional back), that seems to imply that There is a PR in process to add that conditional back, but the reason it was removed in the first place was because it broke Jest (see #5687) which has the opposite problem - because it uses jsdom, "document" does exist, which causes the ternary to take the wrong branch (the browser code) when it should be using the Node branch. I'm trying to find a way to fix things for Vercel that does not break Jest again. |
Can anyone provide a minimal reproduction that I can work with to debug this? |
Getting same error. Whats solution? |
No new version has been published yet. |
We usually publish Thursdays. |
If anyone wants to test out a staging version with the fix, try |
|
Bumped from |
It works for me. Thank you :) |
pushed 9.6.3-20220130341 from 9.6.1 on Vercel and now all Works great! Thanks |
9.6.3-20220130341 works. thanks! any update on production release yet? |
FYI just published 9.6.3 (release notes to come soon). |
thank you so much I upgrade firebase to 9.6.3 and it worked |
Hello, Here is my bug report
[REQUIRED] Describe the problem
Actually I use vercel and when I use "[email protected].* or @9.4." below error happens
But [email protected]. is good to operate.
below is error log
2021-12-17T16:30:40.729Z 7971a748-dd88-4c6e-973a-0d5c122617fc ERROR [2021-12-17T16:30:40.729Z] @firebase/firestore: Firestore (9.4.0): 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:497:3) at Object.readFileSync (fs.js:393: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 Object.loadSync (/var/task/node_modules/@grpc/proto-loader/build/src/index.js:194:31) at loadProtos (/var/task/node_modules/@firebase/firestore/dist/index.node.cjs.js:14437:43) at newConnection (/var/task/node_modules/@firebase/firestore/dist/index.node.cjs.js:14459:20) at OnlineComponentProvider.createDatastore (/var/task/node_modules/@firebase/firestore/dist/index.node.cjs.js:18361:28) 2021-12-17T16:30:40.729Z 7971a748-dd88-4c6e-973a-0d5c122617fc 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:497:3)"," at Object.readFileSync (fs.js:393: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 Object.loadSync (/var/task/node_modules/@grpc/proto-loader/build/src/index.js:194:31)"," at loadProtos (/var/task/node_modules/@firebase/firestore/dist/index.node.cjs.js:14437:43)"," at newConnection (/var/task/node_modules/@firebase/firestore/dist/index.node.cjs.js:14459:20)"," at OnlineComponentProvider.createDatastore (/var/task/node_modules/@firebase/firestore/dist/index.node.cjs.js:18361: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:412:35)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:96:32)"]} Unknown application error occurred
Steps to reproduce / Relevant Code:
This is my code which occurs an error.
When I test, error occurred between collection function call and getDocs function call
Thanks.
The text was updated successfully, but these errors were encountered: