Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升級 Firebase SDK for Cloud Functions 到 1.0 #7

Closed
pc035860 opened this issue May 12, 2018 · 1 comment
Closed

升級 Firebase SDK for Cloud Functions 到 1.0 #7

pc035860 opened this issue May 12, 2018 · 1 comment
Assignees

Comments

@pc035860
Copy link
Owner

pc035860 commented May 12, 2018

https://firebase.google.com/docs/functions/beta-v1-diff

@pc035860 pc035860 self-assigned this May 12, 2018
pc035860 added a commit that referenced this issue May 12, 2018
`firebase-admin` require `firebase-functions` to be required before initialization.
(depends on `firebase-functions`'s side effects)
This only required when deployed, can't be tested at local.
@pc035860
Copy link
Owner Author

因為現在 Firebase 後端也還在 migrate 到 1.0 (?),這邊有一個 hack 要注意。

根據
firebase/firebase-functions#220 (comment)

initializeApp() 前必須要先加入 firebase-functions 的 side effect。

const functions = require('firebase-functions');  // 後面用不到,但還是要 require
const admin = require('firebase-admin');

admin.initializeApp();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant