Skip to content

SSR mode: This operation is not supported in the environment this application is running on. "location.protocol" must be http or https and web storage must be enabled #2570

@rmcsharry

Description

@rmcsharry

Version info

Angular: 9.1

Firebase: 7.13.2

AngularFire: 6.0.0

Other (e.g. Ionic/Cordova, Node, browser, operating system): The error happens when running ng run <project>:serve-ssr on local OS (Mac or Windows) However it seems that auth still works. So maybe this should be a warning and not an error? We can still login and everything works fine.

How to reproduce these conditions

Run Angular in SSR mode (using Nest)

Steps to set up and reproduce

I'm not really sure how to reproduce this. I believe it started appearing in our logs when we first implemented AngularFireAuth.

Debug output

** Errors in the JavaScript console **

** Angular Universal Live Development Server is listening on http://localhost:4200, open your browser on http://localhost:4200 **
Auth Failed [u [Error]: This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.] {
  code: 'auth/operation-not-supported-in-this-environment',
  a: null
}

** Output from firebase.database().enableLogging(true); **

No output shown.

Expected behavior

Not to see the error in the log.

Actual behavior

Error in log. But nothing seems to be broken. Should this be a warning instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions