Comments (2)
This issue does not seem to follow the issue template. Make sure you provide all the required information.
from angularfire.
Somehow able to solve this by loading the settings from API and setting them in localstorage.
For the first time when the app loads it fails but later onwards it will fetch the data from localStorage.
This may be helpful to others.
main.ts
getConfig().then(async config => {
if (config) {
setFirebaseConfig(config);
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.error(err));
}
});
API getConfig()
export async function getConfig() {
return fetch('http://localhost:8081/v1/firebase-config').then((response) => {
return response.json();
});
}
appModule.ts
AngularFireModule.initializeApp({
apiKey: localStorage.getItem('apiKey') ?? '',
authDomain: localStorage.getItem('authDomain') ?? '',
projectId: localStorage.getItem('projectId') ?? '',
storageBucket: localStorage.getItem('storageBucket') ?? '',
messagingSenderId: localStorage.getItem('messagingSenderId') ?? '',
appId: localStorage.getItem('appId') ?? '',
measurementId: localStorage.getItem('measurementId') ?? '',
})
from angularfire.
Related Issues (20)
- The convience observables provided by the Auth module are no longer type safe HOT 3
- [Feature Request] authCanMatchGuard + helpers HOT 1
- Implementing Firebase App Check Debug Token in an Angular Application HOT 1
- `ng deploy` infinite setup loop HOT 3
- GRPC-JS vulnerability,
- Two consecutive `subscribe` calls on the Observable created by `authState()` cause Angular app to never become stable.
- ng-deploy's browserTarget and prerender's browserTarget do not match. Please check your angular.json HOT 1
- setPersistence in AngularFire _BrowserLocalPersistence cannot be invoked without 'new'` HOT 1
- Timeout just in the first load with Angular 18 and SSR HOT 4
- Error uploading image: Error: Either AngularFireModule has not been provided in your AppModule ( project v17 standalone) HOT 3
- ERROR TypeError: Cannot read properties of undefined (reading 'firestore') HOT 3
- 8.1.0: Firebase "Class extends value undefined is not a constructor or null" HOT 2
- Bug Report: Build and Publish Failures After Adding Playwright Tests (node_modules\rxfire\firestore\lite\interfaces.d.ts) HOT 1
- Installing @angular/fire on IDX adds an unrecognized locationId HOT 3
- Firebase.json empty after running 'ng add @angular/fire' HOT 3
- Class extends value undefined is not a constructor or null HOT 1
- An unhandled exception occurred: Missing "./storage/storage" specifier in "@angular/fire" package HOT 2
- Typing is lost when a converter is specified in versions > 6.0.3 HOT 1
- docData observable stream emits identical object values multiple times in a row HOT 1
- how to Initialize the config dynamically? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angularfire.