Skip to content

FR: allow import 'firebase/remote-config' for server side rendering #2242

Open
@hecateball

Description

@hecateball

[REQUIRED] Describe your environment

  • Operating System version: (not related)
  • Browser version: (not related)
  • Firebase SDK version: 7.1.0
  • Firebase Product: Remote Config

[REQUIRED] Describe the problem

Importing 'firebase/remote-config' where the Window object is undefined throws error, thus we have to avoid import 'firebase/remote-config' at server side rendering.

(Specifically, this is quite troublesome for universal web apps built with Nuxt.js. Since this issue
occurs when import files using 'firebase/remote-config', it cannot be used in any Vue components, or must use dynamic import and treat Promise somehow...)

It would be highly appreciated if firebase/remote-config run without caching on server side. At least, make it possible to import without the Window object.

Steps to reproduce:

  1. import 'firebase/remote-config' in any javascript code.
  2. run that code wherever the Window object is undefined.

Relevant Code:

https://github.com/firebase/firebase-js-sdk/blob/master/packages/remote-config/index.ts#L48-L51

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions