firebase / firebase/firebase-js-sdk

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

Open
#2,242 28 comments 72 reactions 0 assignees View on GitHub
api: remoteconfig feature request
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [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.
1. 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.