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

AngularFireModule from @angular/fire/compat not providing the database appropriately.

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

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
angular, typescript
領域
database

調査の方向性

まず、示されている app.config.ts と AngularFireDatabase を注入する Postingservice を使って injection エラーを再現します。compat のデータベース設定と standalone provider の設定を併せて確認し、その後、AngularFireDatabase を注入でき、viewPosts() が No provider found エラーなしで /posts を読み取ることを検証します。

索引モデルが issue の本文から書いたものです。

説明

comp: compat needs: more info type: bug version: current (v17+)

So I've been facing an issue for the past couple of days where whenever I try to use the AngularFireDatabase database to read or write to my Firebase database my console gives me the error:

Image

No provider found for Database2. Source: Standalone[_Homecomponent].

I'm currently running Angular 20.0 as AngularFire 21.0 is yet to be fully fleshed out.

My dummy service to test the data looks like this below:

Image

import { Injectable } from '@angular/core';
import { AngularFireDatabase } from '@angular/fire/compat/database';
@Injectable({
providedIn: 'root'
})
export class Postingservice {
constructor(private afDb:AngularFireDatabase){}
viewPosts(){
return this.afDb.list("/posts").valueChanges();
}
}

I've both tried instantiating the afDb in the constructor and using the inject() function and neither have worked to any avail.

Here also is my app.config.ts:

Image

import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';

import { initializeApp, provideFirebaseApp } from '@angular/fire/app';
import { getDatabase, provideDatabase } from '@angular/fire/database';
import { routes } from './app.routes';

export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideFirebaseApp(() =>
initializeApp({
// FIREBASE CONFIG DATA
})),
provideDatabase(() => getDatabase()),
]
};

I've even provided the provideDatabase() function even as it's not necessary for the AngularFireDatabase as a provider and likewise it's been to no avail...

And my application is bootstrapping correctly as it runs just fine until I create an instance of the afDb database in a component where I then get the above stated error. Kindly help.

主要言語
TypeScript
スター
7.8k
フォーク
2.2k
平均マージ
3日 6時間
マージ済み PR(30日)
5

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

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

はじめの一歩

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

angular/angularfire のほかの issue

angular/angularfire の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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