LoginSignup
0

More than 1 year has passed since last update.

Cloud Firestoreのexportに失敗する場合

Last updated at Posted at 2022-05-26

公式URL

データのエクスポートをスケジュールする | Firebase Documentation

環境

言語 Node.js 16
確認日時 2022/05/26
確認環境 GCP Console

エラー内容

公式のとおりにやって、このエラーが出る場合

TypeError: Cannot read properties of undefined (reading 'charCodeAt') at peg$parsetemplate

対応

ここの部分の

exports.scheduledFirestoreExport = (event, context) => {
  const databaseName = client.databasePath(
    process.env.GCLOUD_PROJECT,
    '(default)'
  );

process.env.GCLOUD_PROJECT

これをProjectIDに変更する。例えば hoge_projectだったら

exports.scheduledFirestoreExport = (event, context) => {
  const databaseName = client.databasePath(
    'hoge_project',
    '(default)'
  );

こんな感じで変更するとできる。

ドキュメントを改修してもらえるといいですね。

6時間ハマってました。

参考URL

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0