I am attempting the latest Firebase npm module (4.8.1). I am using the commonjs module system with webpack bundling. In order to ensure I'm getting the typings I need I have the following in my package.json:
"dependencies: {
"firebase": "^4.8.1"
},
"devDependencies": {
"@firebase/app": "^0.1.5",
"@firebase/app-types": "^0.1.0",
"@firebase/auth": "^0.3.1",
"@firebase/auth-types": "^0.1.0",
"@firebase/database": "^0.1.6",
"@firebase/database-types": "0.1.0",
}
When I transpile with tsc I get the following errors:
node_modules/@firebase/database/dist/esm/src/api/Database.d.ts(4,33): error TS2307: Cannot find module '@firebase/app-types/private'.
node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts(17,39): error TS2307: Cannot find module '@firebase/app-types/private'.
I find this VERY odd for several reasons:
- I am using CommonJS module system not ESM
- I have assumed that the
@firebase/data-typesis there to provide typings rather than implementation code. That's why I have it listed as as devDependency instead of dependency - Even if I switch all the
@firebase/*to "dependencies" it still gives same error - I did see other people post here that Firebase 4.8.1 has an error in it and that rolling back to 4.8.0 might fix the problem ... but from what I can see 4.8.0 has all sort of "implicit any" errors (which maybe I could justify turning off) but also lots of other deprecations in the API that is exported. Simply put, it appears to me that 4.8.1 is much better as typings reference.