1

私は新しいユーザの作成時に実行される関数を持っています。この関数は、しばしば呼び出されずに最初の呼び出しで失敗します。私は誰かが私にこれを引き起こしている可能性を理解するのを助けることを望んでいます。Firebase関数のストリーム削除エラー

export const onUserCreate = functions.auth.user().onCreate(event => { 

    const user: User = { 
     userId: event.data.uid, 
     email: event.data.email 
    }; 

    return db.doc(`users/${user.userId}`).set(data); 
}); 

enter image description here

+0

これをfirebase-adminとfireabse-functionsライブラリの組み合わせで複製できませんでした。一時的な問題があるかもしれません。いずれにしても、誰かがこの問題を抱えている場合は、できるだけ多くの情報をFirebaseサポートに報告してください。 https://firebase.google.com/support/contact/bugs-features/ –

+0

同じ問題が発生しています。 –

答えて

0

私は以下のように同じを使用して、それがうまく機能したよう:

exports.onUserCreate = functions.auth.user().onCreate(event => { 
    const user = event.data 
    console.log(user); 
}) 
0

これは今Firebase機能とエラーのようだとlooked intoされます。

EDIT:

Hello all, Sebastian from the Firestore SDK team here. We believe this issue is related to the recent update of the GRPC Client SDK and have been running tests with GRPC 1.7.1. So far, we have not been able to reproduce this issue with this older GRPC version.

@google-cloud/firestore is now at 0.10.1. If you update your dependencies, you will be able to pull in this release.

Thanks for your patience.

Sebastian

0

これは、Googleがに探しているように見えるものですので、これはほとんど永久的な答えではありません。

私はGoogleライブラリ全体で同様のエラーメッセージに関するいくつかの調査を行っていましたが、機能の外でGoogleライブラリを初期化するときに時折起こるようです(ファイルの先頭)。

私はグローバルスコープ内で実行の代わりにされている機能の中にこの行を追加しましたし、それがエラーを停止したためになります。

const datastore = require('@google-cloud/datastore')({});

たとえば、代わりに:

const datastore = require('@google-cloud/datastore')({}); 

module.exports.myFunction = function() { 
    datastore.get(key).then().... 
} 

してください

module.exports.myFunction = function() { 
    const datastore = require('@google-cloud/datastore')({}); 
    datastore.get(key).then().... 
} 

Firebaseライブラリのためにも、データストアだけではありません。これはベストプラクティスではなく、バグ修正時に元に戻す必要があります。

0

私は同じ問題がありました。これはFirestore Nodeモジュールのバグです。 @ google-cloud/firestoreをバージョン0.10.1にアップデートしてください。問題を修正する必要があります。

関連する問題