Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With emulator #2738

Closed
wants to merge 3 commits into from
Closed

With emulator #2738

wants to merge 3 commits into from

Conversation

laurentsenta
Copy link
Contributor

State issue number in your PR to close it when PR merged: issue #XXX
e.g. : "Resolve the bundle size ❤️: issue #1234"

@@ -3,6 +3,8 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ThemeService } from '@blockframes/ui/theme';
import { IconService } from '@blockframes/ui/icon-service';
import { TunnelService } from '@blockframes/ui/tunnel';
import firebase from 'firebase';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error in the console says that firebase SDK should be imported like that

import * as firebase from 'firebase/app';
import 'firebase/<PACKAGE>';

constructor(private router: Router, private analytics: FireAnalytics) {
if (window.location.hostname === 'localhost') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "?" after window in window?.location because the app can be rendered in a server (SSR/prerendering) where window doesn't exist.

if (window.location.hostname === 'localhost') {
console.log('testing locally -- hitting local functions and firestore emulators');
theFirebase.functions().useFunctionsEmulator('http://localhost:5001');
theFirebase.firestore().settings({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is this issue thread about the emulator :
angular/angularfire#2183

According to the last comment you should be able to add host & ssl directly in the env config.

@fritzschoff
Copy link
Contributor

looks to me stale

@pldespaigne pldespaigne deleted the with-emulator branch July 29, 2021 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants