firebase / firebase/firebase-js-sdk
@firebase/testing doesn't return firestore() instance when firebase-admin is a dependency
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
### Environment
* Operating System version: macOS 10.14.4
* Browser version: Safari 12.1
* Firebase SDK version: @firebase/testing 0.7.9 through 0.9.4
* Firebase Product: @firebase/testing and firebase-admin
### Description
This is a refinement and isolation of issue #1630 specifically related to firebase-admin breaking @firebase/testing. Even if no code is called in firebase-admin the issue still presents.
`@firebase/testing` doesn't return a `firestore()` instance when `firebase-admin` is a dependency in `package.json`.
Steps to reproduce
1. `git clone https://github.com/firebase/quickstart-nodejs.git`
2. `cd quickstart-nodejs/firestore-emulator/javascript-quickstart/`
3. add `"firebase-admin": "7.3.0"` to `"dependencies"` in package.json. __This is the step which reproduces the issue__
4. `npm install`
5. `firebase serve --only firestore`
Now in the node the run the following code:
`const firebase = require("@firebase/testing");`
`firebase.firestore()`
This will produce an error:
`Thrown:`
`TypeError: firebase.firestore is not a function`
Contributor guide
Assessment
This issue has not been assessed yet.