Giter Club home page Giter Club logo

quickstart-nodejs's Introduction

Firebase Quickstarts for Node.js

A collection of quickstart samples demonstrating the Firebase APIs using the Node.js Admin SDK. For more information, see https://firebase.google.com.

Product Quickstarts

These quickstarts show you how to use Firebase products from your Node.js server:

  • auth-sessions - demonstrates how to use Firebase httpOnly session cookies with the Firebase Admin SDK session management API.
  • config - demonstrates retrieving and updating the Firebase Remote Config template.
  • database - demonstrates how to connect to and use the Firebase Realtime Database using Node.js through a simple social blogging app.
  • messaging - demonstrates sending FCM notification messages to a topic using the Node.js Admin SDK.
  • machine-learning - demonstrates how to manage your hosted ML models.

Testing Quickstarts

The testing quickstarts previously available in this repository have moved to a new location:

https://github.com/firebase/quickstart-testing

How to make contributions?

Please read and follow the steps in the CONTRIBUTING.md

License

See LICENSE

quickstart-nodejs's People

Contributors

abraham avatar bojeil-google avatar clp93 avatar corykrug avatar dependabot[bot] avatar dpebot avatar dwberry avatar egilmorez avatar eomm avatar jhuleatt avatar kevinthecheung avatar kroikie avatar maratvmk avatar markarndt avatar morganchen12 avatar nicolasgarnier avatar nitinsurana avatar rockwotj avatar ryanpbrewster avatar samtstern avatar scottcrossen avatar sensuikan1973 avatar slysteven avatar yuchenshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quickstart-nodejs's Issues

Where exactly is the quickstart

I thought there would be an example showing the capabilities of the firebase emulator, perhaps it is not in the file I was looking for.

How to get message status?

After I sent the message, I got the response below.

{
  "name": "projects/project-id/messages/6406221717276815454"
}

Then how do I get the message status? e.g. open rate, target estimate

database-emulator/javascript-quickstart open-sesame command not working

The current README for the javascript-quickstart of the database-emulator is instructing users to initialize with two commands, however the --open-sesame command is not working.
image

Error message in the command line:

firebase --open-sesame emulators
Error: Did not recognize preview feature 

database-emulator/javascript-quickstart's default test.js npm test fail with error

I git cloned the repo, and successfully did npm install. However, when I try to run npm test (without changing any default code), the test fails with "before" and "after" not defined error:

> [email protected] pretest /home/quickstart-nodejs/database-emulator/javascript-quickstart
> eslint test/*.js


/home/quickstart-nodejs/database-emulator/javascript-quickstart/test/test.js
  40:1  error  'before' is not defined  no-undef
  53:1  error  'after' is not defined   no-undef

Is this related to mocha? (i suspect it is the eslint linting issues)

Does Firebase Admin SDK support Firestore Emulator?

I'm trying to set up a local environment running with the Firestore Emulator and Node.js but when I ran my script it wrote the data to the hosted Firestore instead of the local one.

I'm using the "Initialize in your own server" setup described here and setting export FIRESTORE_EMULATOR_HOST=[::1]:8080,127.0.0.1:8080 on my terminal.

Am I doing something wrong or this simply doesn't have support?

Thanks

Surpress firestore output

I was wondering if there would be a way to surpress logs from the firestore emulator? I would like to use start-server-and-test to test firestore rules, but the output gets cluttered from both the emulator and test bench.

Not Working anymore

I cloned this and it's not working anoymore .. seems like packages are outdated ..

on which node version it works fine ?

403 when trying to retrieve

I was getting:

Unable to get template.
undefined

so I examined the code and modified it to:

        console.log("Unable to get template.");
        console.log(resp.statusCode);
        console.log(resp.error);

to see the status code at least since resp.error is empty and resp is very large.

and now I get:

Unable to get template.
403
undefined

I have the firebase-admin for the database working so I know that my PK should be working. I thought I may only have it enabled for the realtime database but I couldn't figure out where to see info on that or how to modify it.

UnsupportedClassVersionError

Running the emulator after firebase setup:emulators:firestore gives the following error:

firebase serve --only firestore                                                                
✔  firestore: started on http://localhost:8080
⚠  firestore: Exception in thread "main"
⚠  firestore: java.lang.UnsupportedClassVersionError: com/google/cloud/datastore/emulator/firestore/CloudFirestore : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
⚠  firestore:
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
⚠  firestore:
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
⚠  firestore:


Error: firestore: emulator has exited with code: 1

UnhandledPromiseRejectionWarning

I have an error when run node index.js common-message

(node:2440) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'auth' of undefined
at C:\ggggg\quickstart-nodejs\messaging\index.js:25:32
at new Promise ()
at getAccessToken (C:\ggggg\quickstart-nodejs\messaging\index.js:23:10)
at sendFcmMessage (C:\ggggg\quickstart-nodejs\messaging\index.js:49:3)
at Object. (C:\ggggg\quickstart-nodejs\messaging\index.js:130:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
(node:2440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:2440) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Firestore emulator: 'operation failed' when setting fields with hyphens in a transaction

My colleague @merlinnot mentioned that this is the repo where we should report issue with the Firestore emulator.

We encountered an issue with the emulator when we try to set a document in a transaction with field names containing hyphens, e.g.:

const ref = firestore().collection('collection').doc('doc');
transaction.set(ref, {
    'test-field': 'test-value',
});
transaction.commit();

This is properly supported in the firestore admin and client SDKs.

The emulator gives the following output:

API endpoint: http://[::1]:8080
API endpoint: http://127.0.0.1:8080
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

   export FIRESTORE_EMULATOR_HOST=[::1]:8080,127.0.0.1:8080

Dev App Server is now running.

Apr 02, 2019 8:25:12 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
Apr 02, 2019 8:25:12 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
Apr 02, 2019 8:25:14 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
INFO: operation failed: com/google/storage/googlesql/GoogleSQLStrings

After digging a bit deeper I noticed that there is an attempted call to com.google.storage.googlesql.GoogleSQLStrings.unescapeIdentifier(), which is not bundled in the emulator jar so a ClassNotFoundException is thrown.

Client side is passing empty cookie object in the GET request

This issue is regarding the code for in the file mentioned below:
Repo: quickstart-nodejs/auth-sessions/app.js

Once we set up the auth session as directed. We should get session cookie as per the code.

app.get('/profile', function (req, res) { // Get session cookie. var sessionCookie = req.cookies.session || ''; // Get the session cookie and verify it. In this case, we are verifying if the // Firebase session was revoked, user deleted/disabled, etc. admin.auth().verifySessionCookie(sessionCookie, true /** check if revoked. */) .then(function(decodedClaims) { // Serve content for signed in user. return serveContentForUser('/profile', req, res, decodedClaims); }).catch(function(error) { // Force user to login. res.redirect('/'); }); });

However, req.cookies.session returns empty for GET requests but has CSRF and session in a POST request.

`app.get("/profile", (req, res) => {
console.log('Cookies: ', req.cookies); //Empty object, 'Cookies: {}'
res.render("profile");

});

app.post("/profile", (req, res) => {
res.send(req.body.name);
console.log('Cookies: ', req.cookies); //Cookies object with csrf and
session token
});`

Is this because of how I set it up in my app or it is supposed to be only on POST requests? As per the docs on the Firebase website , this is used for POST requests only.

database-emulator/javascript-quickstart no need to have firebase.json to serve database?

To launch the quickstart example in the database-emulator with firebase setup:emulators:database && firebase serve --only database. And it looks like the firebase.json has no effect on the emulator? I removed the firebase.json, and the firebase setup and serve still works.

I am curious to learn if firebase.json is not doing anything for the database-emulator to work?

Firebase 3.0

Allo! Could you please update this to firebase 3? I mean use firebase-admin instead of firebase:
var firebase = require('firebase-admin');
firebase.initializeApp({
credential: firebase.credential.cert(serviceAccount),
databaseURL:"https://URL.firebaseio.com"
})

In firebase official page the update is already did :)
Thanks,
Laura

`npm install` giving errors

I run git clone https://github.com/firebase/quickstart-nodejs and then cd quickstart-nodejs/auth-sessions and finally npm install

npm install gives me the following errors:

> [email protected] install C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.9.1/node-v64-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.9.1/node-v64-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\Cory\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Cory\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at C:\Users\Cory\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Cory\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\\Users\\Cory\\desktop\\dev\\quickstart-nodejs\\auth-sessions\\node_modules\\google-gax\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\\Users\\Cory\\desktop\\dev\\quickstart-nodejs\\auth-sessions\\node_modules\\google-gax\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown"
gyp ERR! cwd C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc
gyp ERR! node -v v10.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not okgyp
 ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\Cory\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Cory\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
node-pre-gypgyp  ERR!ERR!  build errorstack     at C:\Users\Cory\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29

gyp ERR!node-pre-gyp  stackERR!     at FSReqWrap.oncomplete (fs.js:154:21)
 stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Cory\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown' (1)
gypnode-pre-gyp  ERR!ERR!  Systemstack Windows_NT 10.0.16299
     at ChildProcess.<anonymous> (C:\Users\Cory\Desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
gypnode-pre-gyp  ERR!ERR!  commandstack "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Cory\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\\Users\\Cory\\desktop\\dev\\quickstart-nodejs\\auth-sessions\\node_modules\\google-gax\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\\Users\\Cory\\desktop\\dev\\quickstart-nodejs\\auth-sessions\\node_modules\\google-gax\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown"
     at ChildProcess.emit (events.js:182:13)
gypnode-pre-gyp  ERR!ERR!  stackcwd     at maybeClose (internal/child_process.js:962:16)
 C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc
node-pre-gypgyp  ERR!ERR!  stacknode -v     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
 v10.14.1
node-pre-gypgyp  ERR!ERR!  Systemnode-gyp -v Windows_NT 10.0.16299
 v3.8.0
node-pre-gypgyp  ERR!ERR!  commandnot ok "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Cory\\Desktop\\dev\\quickstart-nodejs\\auth-sessions\\node_modules\\google-gax\\node_modules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"

node-pre-gyp ERR! cwd C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc
node-pre-gyp ERR! node -v v10.14.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Cory\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions\node_modules\google-gax\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown' (1)
npm WARN [email protected] No repository field.
npm WARN [email protected] license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Cory\AppData\Roaming\npm-cache\_logs\2018-12-17T00_02_47_733Z-debug.log
PS C:\Users\Cory\desktop\dev\quickstart-nodejs\auth-sessions> cd ..
PS C:\Users\Cory\desktop\dev\quickstart-nodejs> cd ..
PS C:\Users\Cory\desktop\dev> cd .\quickstart-nodejs\
PS C:\Users\Cory\desktop\dev\quickstart-nodejs> cd  .\database-emulator\
PS C:\Users\Cory\desktop\dev\quickstart-nodejs\database-emulator>

RealtimeDB getting timeouts from local database during testing

I tried using the quickstart guide to write test for my realtime database. After about 100 write and read requests (about 20 test cases) in a short time all following tests fail with a timeout of 10 seconds. If i delay some of the tests (about 5 seconds every 20 tests) it works.
So it seems like the local emulator for the firebase Realtime DB blocks my connection. But this seems kind of weird, blocking the own localhost connection. The test are all find, i tried swapping the test order and it allways fails after a set amout.
Is there a way to change the emulator behavior so that i dont have to delay my tests ?

There is no emulator output:
xyz:jutta_firebase_functions xyz$ firebase serve --only database 11:52:04.212 [NamespaceSystem-akka.actor.default-dispatcher-2] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started 11:52:04.337 [main] INFO com.firebase.server.forge.App$ - Listening on port 9000

Tests should reference the port from firebase.json

Sometimes another port conflicts with port 8080, so a new port should be made. The coverageUrl in the test assumes port 8080 is used instead of 8025, which is my current port.

Should reference the port in the json file, if available.

Unknown error after download(Error: 2 UNKNOWN)

I did just download, and run, after then, I got this error.

Kousuke-mbp:Repos kousuke$ git clone [email protected]:firebase/quickstart-nodejs.git
Cloning into 'quickstart-nodejs'...
remote: Enumerating objects: 74, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 443 (delta 32), reused 48 (delta 17), pack-reused 369
Receiving objects: 100% (443/443), 211.01 KiB | 2.01 MiB/s, done.
Resolving deltas: 100% (224/224), done.
Kousuke-mbp:Repos kousuke$ cd quickstart-nodejs/firestore-emulator/javascript-quickstart/
Kousuke-mbp:javascript-quickstart kousuke$ npm install

> [email protected] install /Users/kousuke/Repos/quickstart-nodejs/firestore-emulator/javascript-quickstart/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using request for node-pre-gyp https download 
[grpc] Success: "/Users/kousuke/Repos/quickstart-nodejs/firestore-emulator/javascript-quickstart/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node" is installed via remote
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

added 211 packages from 597 contributors and audited 461 packages in 6.737s
found 0 vulnerabilities

Kousuke-mbp:javascript-quickstart kousuke$ node -v
v8.12.0
Kousuke-mbp:javascript-quickstart kousuke$ firebase setup:emulators:firestore
i  firestore: downloading emulator...
Kousuke-mbp:javascript-quickstart kousuke$ firebase --version 
6.1.2
Kousuke-mbp:javascript-quickstart kousuke$ uname -a
Darwin Kousuke-mbp.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64
Kousuke-mbp:javascript-quickstart kousuke$ firebase serve --only firestore
✔  firestore: started on http://localhost:8080
⚠  firestore: Feb 25, 2019 3:38:49 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround
INFO: Unable to apply Java 7 long hostname workaround.

Dev App Server is now running.


API endpoint: http://localhost:8080

^Z
[1]+  Stopped                 firebase serve --only firestore
Kousuke-mbp:javascript-quickstart kousuke$ bg
[1]+ firebase serve --only firestore &
Kousuke-mbp:javascript-quickstart kousuke$ java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
Kousuke-mbp:javascript-quickstart kousuke$ npm test

> [email protected] test /Users/kousuke/Repos/quickstart-nodejs/firestore-emulator/javascript-quickstart
> FIREBASE_FIRESTORE_EMULATOR_ADDRESS='127.0.0.1:8080' mocha



(node:54347) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
⚠  firestore: Feb 25, 2019 3:39:16 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.

⚠  firestore: Feb 25, 2019 3:39:16 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.

  My app
⚠  firestore: Feb 25, 2019 3:39:16 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
INFO: operation failed: unimplemented

    1) "before each" hook for "require users to log in before creating a profile"

View rule coverage information at http://localhost:8080/emulator/v1/projects/firestore-emulator-example:ruleCoverage.html


  0 passing (487ms)
  1 failing

  1) "before each" hook for "require users to log in before creating a profile":
     Error: 2 UNKNOWN: 
      at Object.exports.createStatusError (node_modules/grpc/src/common.js:91:15)
      at Object.onReceiveStatus (node_modules/grpc/src/client_interceptors.js:1204:28)
      at InterceptingListener._callNext (node_modules/grpc/src/client_interceptors.js:568:42)
      at InterceptingListener.onReceiveStatus (node_modules/grpc/src/client_interceptors.js:618:8)
      at callback (node_modules/grpc/src/client_interceptors.js:845:24)



npm ERR! Test failed.  See above for more details.

firestore.Timestamp missing

If you try to initialize an adminApp with:

const projectId = 'dummy'
const firebase = require('@firebase/testing')

const admin = firebase.initializeAdminApp({projectId, databaseName: projectId})

admin.firestore.Timestamp is missing from admin.firestore.

How to handle different URLs

I've a situation, having multiple users, all of them have unique hashId assigned to them, which make their URL different. While my client side updates the data in firebase, I need to apply server interactions to the child_added.

App can have any number of users, how to scale child_added? As reference to every URL is new, I'm not sure of this situation, new to firebase.

serviceAccountKey.json example

Amazing sample project, thanks to you for it!

Would it be possible to add a serviceAccountKey.json example? I would like know what is the file structure.

How to send push notification to more than 10000 users using firebase in nodejs?

If I have more than 10k user, and I have an array of token, how can I send to all of user ? I tried to chunk array 1000 user each time, push 1000 user to a Topic, and remove the user from a topic ( in a loop). But it is running false. Does anyone meet this case? thank you!
Sample code:

let registrationTokens =[
token1,
token2,...
token10000
]
let promises = [];

for (let i = 0; i < 10; i++) {
    promises.push(
        admin
            .messaging()
            .subscribeToTopic(registrationTokens, topic) // subscrible topic 
            .then(function(response) {
                // send message to topic
                admin
                    .messaging()
                    .send(message)
                    .then(response => {
                        // remove user from topic 
                        admin
                            .messaging()
                            .unsubscribeFromTopic(registrationTokens, topic);
                    })
                    .catch(error => {
                        console.log('Error sending message:', error);
                    });
            })
            .catch(function(error) {
                console.log('Error subscribing to topic:', error);
                console.log(error);
                return res.send(error);
            })
    );
}

Promise.all(promises);

Firestore emulator: resource starvation for concurrent operations on a single document

I was instructed by @samtstern to post Firestore Emulator - related issues in this repository, so here we go:

Getting and setting the same reference (two concurrent operations) results in a lock. There are three possible outcomes:

  • operations succeed after a long period of time (~30+ seconds)
  • an UNKNOWN error is returned (code 2)
  • a GOAWAY message is returned

The issue is highly reproducible:

$ time npx ts-node ./test.ts 
2 UNKNOWN: 

real    0m32.538s
user    0m3.862s
sys     0m0.311s

Emulator output:

API endpoint: http://0.0.0.0:8080
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

   export FIRESTORE_EMULATOR_HOST=0.0.0.0:8080

Dev App Server is now running.

Mar 11, 2019 6:18:41 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
Mar 11, 2019 6:18:41 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
Mar 11, 2019 6:19:11 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
INFO: operation failed: null
Mar 11, 2019 6:19:11 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
INFO: operation failed: null

Repro:

import { Firestore } from '@google-cloud/firestore';
import { credentials } from 'grpc';

const firestore = new Firestore({
  'grpc.initial_reconnect_backoff_ms': 500,
  'grpc.max_reconnect_backoff_ms': 1000,
  port: 8080,
  projectId: 'test',
  servicePath: 'localhost',
  sslCreds: credentials.createInsecure(),
});

const ref = firestore.collection('collection').doc('doc');

const run = async () => {
  await Promise.all([ref.get(), ref.set({})]);
};

run().catch(x => console.error(x.message));

Firestore emulator: committing empty batches

I was instructed by @samtstern to post Firestore Emulator - related issues in this repository, so here we go:

Committing empty batches results in an error message

2 UNKNOWN:

Emulator output:

API endpoint: http://0.0.0.0:8080
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

   export FIRESTORE_EMULATOR_HOST=0.0.0.0:8080

Dev App Server is now running.

Mar 11, 2019 6:14:01 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
Mar 11, 2019 6:14:01 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
Mar 11, 2019 6:14:02 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
INFO: operation failed: No value present

Repro:

import { Firestore } from '@google-cloud/firestore';
import { credentials } from 'grpc';

const firestore = new Firestore({
  'grpc.initial_reconnect_backoff_ms': 500,
  'grpc.max_reconnect_backoff_ms': 1000,
  port: 8080,
  projectId: 'test',
  servicePath: 'localhost',
  sslCreds: credentials.createInsecure(),
});

const run = async () => {
  await firestore.batch().commit();
};

run().catch(x => console.error(x.message));

RTDB Trigger functions not being called

Hi,
I saw in the release 7.0.0 of the tools that RTDB triggers should now be supported (https://github.com/firebase/firebase-tools/releases/tag/v7.0.0)

I saw when starting the emulators, that it did print out i functions: Setting up Realtime Database trigger "myTriggerName"

But, when inserting data into the realtime DB, the trigger function is never called. When I run using a real/remote firebase instance, it works.

Should I expect this to be working yet?

"Error: Could not start firestore emulator, port taken."

I have other apps running that's taking 8080. Can we make it a little more flexible to go to a non-8080 port?

Update: I just read the "update your 'firebase.json" part... one sec...

Update two: I can update the config, but how should the config file look...

Update three: In order to clone the files, I had to clone the entire quickstart (not just Firestore). I was running the instructions on the root directory of this instead of the Firestore JS quickstart. I'm a TS newbie, so for quickness I had to cd to the /firestore-emulator/javascript-quickstart (not /typescript-quickstart).

I updated the firebase.json and ran firebase emulators:start --only firestore. It required that I log in, I log in. Then it required that I set up a project, so I link it to a project. Then my update to the firebase.json took place, let me login etc. This solves this issue pretty much.

What my firebase.json looks like after changing the port:

{
  "firestore": {
    "rules": "firestore.rules"
  },
  "emulators": {
    "firestore": {
      "port": 8025
    }
  }
}

firestore-emulator javascript example tests 2 out of 7 fail

Browser: node
Browser version: v10.5.0
Operating system: macOS Mojave
Operating system version: macOS 10.14 (18A391)

What steps will reproduce the problem:

  1. curl https://storage.googleapis.com/firebase-preview-drop/emulator/cloud-firestore-emulator-v1.3.0.jar -o cloud-firestore-emulator-v1.3.0.jar
  2. java -jar cloud-firestore-emulator-v1.3.0.jar (or as an alternative: gcloud alpha emulators firestore start --host-port localhost:8080)
    (when I use firebase serve --only firestore with the tests i get always _ Error: Timeout of 2000ms exceeded. For async tests and hooks..._ so i downloaded the newer version of the emulator)
  3. git clone https://github.com/firebase/quickstart-nodejs.git
  4. cd quickstart-nodejs/firestore-emulator/javascript-quickstart/
  5. npm install
  6. npm test

What is the expected result?
All tests pass because it is an official get startet guide.
What happens instead of that?
Two out of seven tests fail.

> [email protected] test directory
> FIREBASE_FIRESTORE_EMULATOR_ADDRESS='127.0.0.1:8080' mocha



(node:4342) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
  My app
    ✓ require users to log in before creating a profile (318ms)
    ✓ should enforce the createdAt date in user profiles (114ms)
    1) should only let users create their own profile
    ✓ should let anyone read any profile (53ms)
    ✓ should let anyone create a room
    2) should force people to name themselves as room owner when creating a room
    ✓ should not let one user steal a room from another user (77ms)

View rule coverage information at http://localhost:8080/emulator/v1/projects/firestore-emulator-example:ruleCoverage.html


  5 passing (1s)
  2 failing

  1) My app
       should only let users create their own profile:
     FirebaseError: 7 PERMISSION_DENIED: 
evaluation error at L5:24 for 'create' @ L5
      at new FirestoreError (node_modules/@firebase/firestore/dist/index.node.cjs.js:348:28)
      at ClientDuplexStream.<anonymous> (node_modules/@firebase/firestore/dist/index.node.cjs.js:6950:19)
      at ClientDuplexStream._emitStatusIfDone (node_modules/grpc/src/client.js:234:12)
      at ClientDuplexStream._receiveStatus (node_modules/grpc/src/client.js:211:8)
      at Object.onReceiveStatus (node_modules/grpc/src/client_interceptors.js:1306:15)
      at InterceptingListener._callNext (node_modules/grpc/src/client_interceptors.js:568:42)
      at InterceptingListener.onReceiveStatus (node_modules/grpc/src/client_interceptors.js:618:8)
      at -------/node_modules/grpc/src/client_interceptors.js:1123:18

  2) My app
       should force people to name themselves as room owner when creating a room:
     Error: Expected request to fail, but it succeeded.
      at -------/node_modules/@firebase/testing/dist/index.cjs.js:189:31
      at process._tickCallback (internal/process/next_tick.js:68:7)



npm ERR! Test failed.  See above for more details.

Please provide any other information below, and attach a screenshot if possible.

Because of this issue I can't test any of my security rules.

TypeError: app.firestore is not a function when trying to execute Firestore Emulator Tests

When I try to execute the Firestore Emulator Javascript Test from this repository, I receive the following error:

  1) My app
       require users to log in before creating a profile:
     TypeError: app.firestore is not a function
      at initializeApp (node_modules\@firebase\testing\dist\index.cjs.js:108:13)
      at Object.initializeTestApp (node_modules\@firebase\testing\dist\index.cjs.js:78:12)
      at authedApp (test\index.test.js:23:6)
      at Context.it (test\index.test.js:48:16)

authedApp is the following:

function authedApp(auth) {
  return firebase
    .initializeTestApp({ projectId, auth })
    .firestore();
}

I tried everything from locally changing versions, installing more dependencies etc. to running it in docker containers but I can't get it to work. It seems to be really hard to get this running.

Does anyone have a hint for me what I could try?

Installation Instructions

Great sample project! However it seems like it's intended for hosting and execution on Firebase.

Would it be possible to update Readme.md with simple instructions on how to deploy as firebase project?

firestore-emulator/javascript-quickstart doesn't pass tests

I'm unsure if this is related to #35, but here are the repro steps:

$ firebase --version
6.1.1

$ node -v
v8.12.0

$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

$ git clone [email protected]:firebase/quickstart-nodejs.git
$ cd quickstart-nodejs/firestore-emulator/javascript-quickstart/
$ npm install

$ firebase setup:emulators:firestore
i  firestore: downloading emulator...
$ firebase serve --only firestore
✔  firestore: started on http://localhost:8080
⚠  firestore: Nov 21, 2018 4:03:40 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround
INFO: Unable to apply Java 7 long hostname workaround.

Dev App Server is now running.


API endpoint: http://localhost:8080

$ npm test
> [email protected] test quickstart-nodejs/firestore-emulator/javascript-quickstart
> mocha

(node:47062) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
  My app
    ✓ require users to log in before creating a profile (645ms)
    ✓ should enforce the createdAt date in user profiles (229ms)
    ✓ should only let users create their own profile (60ms)
    1) "before each" hook for "should let anyone read any profile"

  3 passing (5s)
  1 failing

  1) "before each" hook for "should let anyone read any profile":
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

Here are the logs for the firestore emulator:

⚠  firestore: Nov 21, 2018 4:11:17 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
INFO: operation failed: 
Null value error. for 'create' @ L5, Null value error. for 'create' @ L5

⚠  firestore: Nov 21, 2018 4:11:17 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
INFO: operation failed: 
Property createdAt is undefined on object. for 'create' @ L5, Property createdAt is undefined on object. for 'create' @ L5

⚠  firestore: Nov 21, 2018 4:11:19 PM com.google.cloud.datastore.emulator.impl.util.WrappedStreamObserver onError
INFO: operation failed: 
false for 'create' @ L5

firestore-emulator/*-quickstart: TypeError: firebase.clearFirestoreData is not a function

Doing a by-the-numbers clone, install, npm test of the emulator examples results in TypeError: firebase.clearFirestoreData is not a function

katowulf-macbookpro1:javascript-quickstart katowulf$ npm test

> [email protected] test /Users/katowulf/projects/quickstart-nodejs/firestore-emulator/javascript-quickstart
> FIREBASE_FIRESTORE_EMULATOR_ADDRESS='127.0.0.1:8080' mocha

(node:3160) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
  My app
    1) "before each" hook for "require users to log in before creating a profile"

View rule coverage information at http://localhost:8080/emulator/v1/projects/firestore-emulator-example:ruleCoverage.html


  0 passing (630ms)
  1 failing

  1) "before each" hook for "require users to log in before creating a profile":
     TypeError: firebase.clearFirestoreData is not a function
      at Context.beforeEach (test/test.js:33:18)

Quickstart rule testing doesn't work with non-8080 ports

Browser: N/A
Browser version: N/A
Operating system: Windows
Operating system version: 8.1

What steps will reproduce the problem:

  1. Create a firebase.json with a port set to 8025
{
  "firestore": {
    "rules": "firestore.rules"
  },
  "emulators": {
    "firestore": {
      "port": 8080
    }
  }
}
  1. Update the coverageUrl to be 8025 in test.js
  2. Run it.

What is the expected result?
Run the tests on the rule set for the Firestore db.

What happens instead of that?

  0 passing (1s)
  1 failing

  1) "before all" hook:
     Error: 14 UNAVAILABLE: Trying to connect an http1.x server
      at Object.exports.createStatusError (node_modules\grpc\src\common.js:91:15)
      at Object.onReceiveStatus (node_modules\grpc\src\client_interceptors.js:1204:28)
      at InterceptingListener._callNext (node_modules\grpc\src\client_interceptors.js:568:42)
      at InterceptingListener.onReceiveStatus (node_modules\grpc\src\client_interceptors.js:618:8)
      at callback (node_modules\grpc\src\client_interceptors.js:845:24)

Uncaught Error: FIRESTORE (5.5.9) INTERNAL ASSERTION FAILED for two server timestamps

Hey there,

I'm playing around with the firestore-emulator typescript test setup. Unfortunately when I add another server timestamp to one of the assertions I get an error. I changed the following test case to have an additional updatedAt field (line 92 in quickstart-nodejs/firestore-emulator/typescript-quickstart/test.ts):

  @test
  async "should only let users create their own profile"() {
    const db = authedApp({ uid: "alice" });
    await firebase.assertSucceeds(
      db
        .collection("users")
        .doc("alice")
        .set({
          birthday: "January 1",
          createdAt: firebase.firestore.FieldValue.serverTimestamp(),
          updatedAt: firebase.firestore.FieldValue.serverTimestamp(), <---- this is new
        })
    );
    await firebase.assertFails(
      db
        .collection("users")
        .doc("bob")
        .set({
          birthday: "January 1",
          createdAt: firebase.firestore.FieldValue.serverTimestamp()
        })
    );
  }

When running npm test I get the following error:


> [email protected] pretest /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart
> tsc


> [email protected] test /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart
> FIREBASE_FIRESTORE_EMULATOR_ADDRESS='127.0.0.1:8080' mocha



  MyApp
    ✓ require users to log in before creating a profile (76ms)
    ✓ should enforce the createdAt date in user profiles (90ms)
    1) should only let users create their own profile
    2) "after each" hook for "should only let users create their own profile"


  2 passing (310ms)
  2 failing

  1) MyApp
       should only let users create their own profile:
     Uncaught Error: FIRESTORE (5.5.9) INTERNAL ASSERTION FAILED: server transform result count (1) should match field transform count (2)
      at fail (node_modules/@firebase/firestore/dist/index.node.cjs.js:153:11)
      at assert (node_modules/@firebase/firestore/dist/index.node.cjs.js:161:9)
      at TransformMutation.serverTransformResults (node_modules/@firebase/firestore/dist/index.node.cjs.js:3867:9)
      at TransformMutation.applyToRemoteDocument (node_modules/@firebase/firestore/dist/index.node.cjs.js:3819:37)
      at MutationBatch.applyToRemoteDocument (node_modules/@firebase/firestore/dist/index.node.cjs.js:7501:37)
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:12302:33
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:7764:63
      at PersistencePromise.wrapUserFunction (node_modules/@firebase/firestore/dist/index.node.cjs.js:7750:26)
      at PersistencePromise.wrapSuccess (node_modules/@firebase/firestore/dist/index.node.cjs.js:7764:25)
      at PersistencePromise.next (node_modules/@firebase/firestore/dist/index.node.cjs.js:7725:29)
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:12297:18
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:4320:13
      at LLRBNode.inorderTraversal (node_modules/@firebase/firestore/dist/index.node.cjs.js:1832:13)
      at SortedMap.inorderTraversal (node_modules/@firebase/firestore/dist/index.node.cjs.js:1708:26)
      at SortedSet.forEach (node_modules/@firebase/firestore/dist/index.node.cjs.js:4319:19)
      at LocalStore.applyWriteToRemoteDocuments (node_modules/@firebase/firestore/dist/index.node.cjs.js:12292:17)
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:11950:30
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:7764:63
      at PersistencePromise.wrapUserFunction (node_modules/@firebase/firestore/dist/index.node.cjs.js:7750:26)
      at PersistencePromise.wrapSuccess (node_modules/@firebase/firestore/dist/index.node.cjs.js:7764:25)
      at PersistencePromise.next (node_modules/@firebase/firestore/dist/index.node.cjs.js:7725:29)
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:11949:18
      at MemoryPersistence.runTransaction (node_modules/@firebase/firestore/dist/index.node.cjs.js:12999:16)
      at LocalStore.acknowledgeBatch (node_modules/@firebase/firestore/dist/index.node.cjs.js:11944:33)
      at SyncEngine.applySuccessfulWrite (node_modules/@firebase/firestore/dist/index.node.cjs.js:16159:14)
      at RemoteStore.onMutationResult (node_modules/@firebase/firestore/dist/index.node.cjs.js:14876:32)
      at PersistentWriteStream.onMessage (node_modules/@firebase/firestore/dist/index.node.cjs.js:13866:34)
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:13697:30
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:13737:28
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:7227:20
      at process._tickCallback (internal/process/next_tick.js:68:7)

  2) MyApp
       "after each" hook for "should only let users create their own profile":
     Error: FIRESTORE (5.5.9) INTERNAL ASSERTION FAILED: AsyncQueue is already failed: Error: FIRESTORE (5.5.9) INTERNAL ASSERTION FAILED: server transform result count (1) should match field transform count (2)
    at fail (node_modules/@firebase/firestore/dist/index.node.cjs.js:153:11)
    at assert (node_modules/@firebase/firestore/dist/index.node.cjs.js:161:9)
    at TransformMutation.serverTransformResults (node_modules/@firebase/firestore/dist/index.node.cjs.js:3867:9)
    at TransformMutation.applyToRemoteDocument (node_modules/@firebase/firestore/dist/index.node.cjs.js:3819:37)
    at MutationBatch.applyToRemoteDocument (node_modules/@firebase/firestore/dist/index.node.cjs.js:7501:37)
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:12302:33
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:7764:63
    at PersistencePromise.wrapUserFunction (node_modules/@firebase/firestore/dist/index.node.cjs.js:7750:26)
    at PersistencePromise.wrapSuccess (node_modules/@firebase/firestore/dist/index.node.cjs.js:7764:25)
    at PersistencePromise.next (node_modules/@firebase/firestore/dist/index.node.cjs.js:7725:29)
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:12297:18
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:4320:13
    at LLRBNode.inorderTraversal (node_modules/@firebase/firestore/dist/index.node.cjs.js:1832:13)
    at SortedMap.inorderTraversal (node_modules/@firebase/firestore/dist/index.node.cjs.js:1708:26)
    at SortedSet.forEach (node_modules/@firebase/firestore/dist/index.node.cjs.js:4319:19)
    at LocalStore.applyWriteToRemoteDocuments (node_modules/@firebase/firestore/dist/index.node.cjs.js:12292:17)
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:11950:30
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:7764:63
    at PersistencePromise.wrapUserFunction (node_modules/@firebase/firestore/dist/index.node.cjs.js:7750:26)
    at PersistencePromise.wrapSuccess (node_modules/@firebase/firestore/dist/index.node.cjs.js:7764:25)
    at PersistencePromise.next (node_modules/@firebase/firestore/dist/index.node.cjs.js:7725:29)
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:11949:18
    at MemoryPersistence.runTransaction (node_modules/@firebase/firestore/dist/index.node.cjs.js:12999:16)
    at LocalStore.acknowledgeBatch (node_modules/@firebase/firestore/dist/index.node.cjs.js:11944:33)
    at SyncEngine.applySuccessfulWrite (node_modules/@firebase/firestore/dist/index.node.cjs.js:16159:14)
    at RemoteStore.onMutationResult (node_modules/@firebase/firestore/dist/index.node.cjs.js:14876:32)
    at PersistentWriteStream.onMessage (node_modules/@firebase/firestore/dist/index.node.cjs.js:13866:34)
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:13697:30
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:13737:28
    at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/firestore/dist/index.node.cjs.js:7227:20
    at process._tickCallback (internal/process/next_tick.js:68:7)
      at fail (node_modules/@firebase/firestore/dist/index.node.cjs.js:153:11)
      at AsyncQueue.verifyNotFailed (node_modules/@firebase/firestore/dist/index.node.cjs.js:7272:13)
      at AsyncQueue.enqueue (node_modules/@firebase/firestore/dist/index.node.cjs.js:7224:14)
      at FirestoreClient.shutdown (node_modules/@firebase/firestore/dist/index.node.cjs.js:17779:32)
      at Firestore.<anonymous> (node_modules/@firebase/firestore/dist/index.node.cjs.js:19024:69)
      at step (node_modules/tslib/tslib.js:133:27)
      at Object.next (node_modules/tslib/tslib.js:114:57)
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/tslib/tslib.js:107:75
      at new Promise (<anonymous>)
      at Object.__awaiter (node_modules/tslib/tslib.js:103:16)
      at Object.delete (node_modules/@firebase/firestore/dist/index.node.cjs.js:19021:57)
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/app/dist/index.node.cjs.js:102:47
      at Array.map (<anonymous>)
      at /Users/XXXXXX/quickstart-nodejs/firestore-emulator/typescript-quickstart/node_modules/@firebase/app/dist/index.node.cjs.js:101:41

What am I doing wrong? 🤔

Thanks in advance!

Not redirecting to Profile page.

I am testing with auth-sessions example. It shows the Sign button. After SignIn it is not redirecting to Profile page instead redirects to same SignIn page with 2 button Sign by Google and Sign in by Email Id.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.