I am trying to use the firebase-counter extension on Angular v14. I have upgraded the dependencies in package.json
as follows. This step is necessary as the uuid
dependency is giving a lot of problems with v3.3.2.
{
"name": "firestore-counter-web",
"version": "1.0.0",
"main": "src/index.js",
"author": "patryk@google.com",
"license": "Apache-2.0",
"description": "Web SDK to access sharded counters.",
"dependencies": {
"@types/uuid": "^8.3.4",
"uuid": "^9.0.0"
},
"scripts": {
"build": "npx webpack",
"format": "prettier --write {,**/}*.{yaml,ts,md}"
},
"devDependencies": {
"firebase": "^9.13.0",
"prettier": "^2.7.1",
"ts-loader": "^9.4.1",
"typescript": "^4.8.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
}
I then install this package into my Angular application as follows.
npm install ~/path/to/git/repo/extensions/firestore-counter/clients/web
The installation works but when I try to build my application ng build
I get a bunch of errors. One of them is as follows.
Error: ../../extensions/firestore-counter/clients/web/src/index.ts:27:24 - error TS2694: Namespace '"/path/to/angular/app/www/node_modules/firebase/compat/index"' has no exported member 'firestore'. 27 private db: firebase.firestore.Firestore = null;
There is another post like mine from 2.5 years ago, which I tried, but still did not resolve the error.
Any ideas on how to resolve this issue?