This page (revision-1) was last changed on 20-Apr-2024 11:53 by UnknownAuthor

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
20-Apr-2024 11:53 1 KB UnknownAuthor

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 added 32 lines
[{PageViewPlugin}]
[Firestore]
!!!Abstract
|[Firebase]のFunctionsを使ってみる。
!!!Topics
!!Quick Start
*js
{{{
Running command: npm --prefix "$RESOURCE_DIR" run lint
}}}
|進めていくと、firebase deployをやるあたりで、こういうのがでてきて、
{{{
Oops! Something went wrong! :(
...
No files matching the pattern "." were found.
Please check for typing mistakes in the pattern.
}}}
|となる。なんとなくWindowsでやると避けられないっぽい[1]ので、firebase.jsonにあるpredeployの部分の該当するところをコメントアウトするとうまく動くようになる。
!!やりたいこと
*[Firestore]にデータが追加されたら、何かやる。
|I want to do this[2].ハローワールドに相当するのはここかな[3]。
|functionsフォルダの中のindex.jsをいじっていくのが基本。
|realtime databaseとcloud firestoreでアクセス方法が異なるので注意。database.ref()とfirestore.document()
|HTTP Error: 400, Change of function trigger type or event provider is not allowedがでたら、そのFunctionを一度削除してもう一度Deployすると動く[4]
*VSCでデバッグができないか。
!!!Reference
#[#1]001AJD, 2018年7月, Deploy error on Windows: "Running command: npm --prefix "$RESOURCE_DIR" run lint" #822, [https://github.com/firebase/firebase-tools/issues/822]
#[#2]Google, 2018年6月、Realtime Database トリガー, [https://firebase.google.com/docs/functions/database-events?hl=ja]
#[#3]koki_cheese, 2017年03月12日に更新, Cloud Functions for Firebaseとは?, [https://qiita.com/koki_cheese/items/013d4e6ab5aefc792388]
#[#4]吉川 正倫, 2018年1月17日, GoogleのFirebaseが面白いかもしれない 〜Functions〜,[https://norm-nois.com/blog/archives/4040]