TypeError: module.exports.v1 is not a constructor, error thrown from google-cloud/firestore when using firebase-admin sdk - firebase

Recently I encountered the above error (TypeError: module.exports.v1 is not a constructor) when trying to run firebase-firestore related tests. Earlier I had no issue running the tests but after doing a npm install was getting the above error.
The source of the error is from google-cloud/firestore which is required by firebase-admin.
Tried several options but it doesn't seems to get resolved. I then tried with an older node-module and it worked as expected.

The problem was due to the test framework I've been using. Once I changed from jest to mocha the problem got solved.

When I updated firebase admin sdk from 8.4.0 to higher then I had same error in running jest test code.
I fixed it to add --env node option for jest.
jest --env node

I hit this error when I left out an await on an async function. That caused my code to continue running after the jest environment had been torn down.
There was a message that said ReferenceError: You are trying to import a file after the Jest environment has been torn down. which should have been a tip that I was running async code and not waiting for completion.

We needed to upgrade node from v8.11.3 to v8.16.2.

Related

#prisma/client did not initialize yet with NextJS

Hi I'm using MongoDB and Prisma with my NextJS 13 app.
When I try to send a POST request I get this error
Error: #prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
I initilized prisma/client before npm run dev. Also tried to install everything again but nothing worked and prisma generate won't work in terminal.

Firebase Deploy throws errors while my teammate's works fine after cloning the same branch

Error: functions predeploy error: Command terminated with non-zero exit code 2
This error shows up when I try to deploy my firebase function along with 134 errors from node_modules/#types///.
I am running the below configuration:
The deploy works perfectly fine from my teammate's device.
I tried to remove and reinstall node module packages too but nothing seems to fix the problem. I also tried using a downgraded version of node using nvm (Node version 14) but it still doesn't address the issue.
Also the function that was deployed by him is not accessible by me from my browser, where I get the error:
I also tried other solutions on stackoverflow with similar problems but they didnt work. One of them was : https://stackoverflow.com/questions/68886279/firebase-function-deploy-throwing-typescript-errors

Cloud Run Run/Debug has stopped working - Exited with code 127

The cloudrun debug in cloud shell was working. It is no longer working for me with the following output.
I have 1) rebooted the VM and 2) I have tried another project that was also working previously.
I suspect something has changed in my environment
Starting to debug the app using configuration 'Cloud Run: Run/Debug
Locally' from .vscode/launch.json... To view more detailed logs, go to
Output channel : "Cloud Run: Run/Debug Locally - Detailed" Dependency
check started Dependency check succeeded Unpausing minikube flag needs
an argument: --status-check See 'skaffold debug --help' for usage.
Exited with code 127. Cleaning up... Finished clean up.
This bug was introduced in the v1.17.1 release of Cloud Code for VS Code, due to a change in v1.37.0 of Skaffold related to the --status-check parameter. This bug was addressed in v1.17.2 of Cloud Code for VS Code, and upgrading to this version (or later) should fix this issue.

Vercel deploy of my NextJS app with Font Awesome Pro is returning a 401 build error

I am attempting to install Font Awesome Pro in my NextJS app, which is deployed via Vercel. However, I keep getting this error:
error An unexpected error occurred: "https://npm.fontawesome.com/#fortawesome/pro-light-svg-icons/-/5.15.4/pro-light-svg-icons-5.15.4.tgz: Request failed \"401 Unauthorized\""
Then the build exits with Error: Command "yarn install" exited with 1
Locally everything works great. I have the following in my .npmrc file:
#fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=NPM_RC
And then within Vercel settings I have an environmental variable with the name NPM_RC and the value is my personal Pro-Token.
As an aside: I tried doing a global setup using my token but that returns the same error mentioned above. When I reached out to Font Awesome they said that Global setups can be hit or miss and that I should try the .npmrc route.
I reached out to Font Awesome after giving the .npmrc route and try and still having the error. They are not sure what is going on... I am stuck and any help would be greatly appreciated. Cheers!
I needed to update my .npmrc file with the following:
#fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${NPM_RC}
Thank you #robmadole!

Error on meteor project setup

I setup meteor environment
meteor create todoapp
cd todoapp
Then write meteor and press enter after then I run on localhost:3000 then I receive following error on terminal
Exception from sub meteor_autoupdate_clientVersions id fRm2pMK35Ji2uPut5
TypeError: Cannot read property 'OneOf' of undefined
I don't know what the actual reason of this issue any way I found a solution I uninstalled Meteor the reinstalled it after this the issue has been resolved.

Resources