Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Unsupported Realtime Database URL - FIREBASE FATAL ERROR: Cannot parse Firebase url

オープン
#2,589 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

@lahirumaramba がすでに取り組んでいます。

2024年6月5日 から。

評価

この issue はまだ評価されていません。

説明

api: database
[READ] Step 1: Are you in the right place?
  • For issues related to the code in this repository file a Github issue.
  • If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
    template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.
[REQUIRED] Step 2: Describe your environment
  • Operating System version: Windows 11 23H2
  • Firebase SDK version: ^12.1.0
  • Firebase Product: Hosting and Realtime Database
  • Node.js version: v20.11.1
  • NPM version: 10.8.1
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:

I follow this tutorial to set up the Hosting, Cloud Functions, and Realtime Database.
https://developers.home.google.com/codelabs/smarthome-washer#1
After deployment, I visited the site and got this error from the console.

Uncaught Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com at st (util.ts:172:9) at Qt (parser.ts:88:5) at Oi.databaseFromApp (RepoManager.ts:108:21) at Qi.INTERNAL.registerComponent.z.setServiceProps.Reference [as instanceFactory] (index.ts:52:42) at S.getOrInitializeService (provider.ts:190:33) at S.getImmediate (provider.ts:95:29) at q._getService (firebaseApp.ts:127:54) at c.<computed> [as database] (firebaseNamespaceCore.ts:228:29) at Object.i [as database] (firebaseNamespaceCore.ts:209:32) at SmartHome.handleData (main.js:70:12)

I found that it is caused by const parsedUrl = parseDatabaseURL(dataURL) in parser.ts, it doesn't support the URL with 4 parts.
Firebase projects with Realtime Database in us-central1 region work fine (3 parts)
https://x.firebaseio.com
But other regions don't work (4 parts)
https://x.asia-southeast1.firebasedatabase.app

This is the code causing the error, I didn't modify it much from the example given in the tutorial
firebase.database().ref('/').child('washer').on("value", (snapshot) => { ...

主要言語
TypeScript
スター
1.7k
フォーク
419
平均マージ
4日 20時間
マージ済み PR(30日)
16

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

firebase/firebase-admin-node のほかの issue

firebase/firebase-admin-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。