Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 949
Supun Muthutantrige Avatar asked Sep 01 '25 16:09

Supun Muthutantrige


1 Answers

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

like image 183
Supun Muthutantrige Avatar answered Sep 04 '25 06:09

Supun Muthutantrige