question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firestore is not instantiated in the window object anymore

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: 11.4.1

Platform: Mac

[REQUIRED] Test case

Start the emulator with Firestore Go into the web console, try to access firestore from it

image

[REQUIRED] Steps to reproduce

Above

[REQUIRED] Expected behavior

Should be able to access it from the window object in the dev console as usual.

[REQUIRED] Actual behavior

Firestore is not accessible from the console anymore since v11.2ish

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
yuchenshicommented, Sep 13, 2022

@MorenoMdz I’ve discussed this with @christhompsongoogle and a few other colleagues. As much as we’d like to retain this feature, it is technically hard (and near infeasible). While we can still expose the app object or the firestore object, those will be near useless without the free-floating functions like doc(firestore, 'a/b') in modular v9 SDK. Chaining from firestore.collection('....').doc('...') is no longer possible in the new v9 SDK syntax. While I cannot speak for the Firebase Console team, the deprecation of v8 SDK is in place and moving towards the new syntax is inevitable in the long run. Not shipping the whole SDK also allows us to vastly reduce the bundle size (and therefore the download / loading time of Emulator UI, and maybe Console in the future.)

With that being said, we’re open to ideas to reimplement this feature within the new constraints. And who knows, maybe your idea can help us keep this feature in the Console as well. Also, just a friendly reminder that the Emulator UI is an open source project and we welcome PRs and discussions at any time. While we’re closing this issue due to reasons above, the comment thread is still open – it only takes one good PR or suggestion to continue the discussion. “Can we make it available again somehow”? Well, let’s talk about “how” 😃 .

1reaction
MorenoMdzcommented, Aug 15, 2022

So this was likely caused by the transition to the modular Javascript SDK in v9. The firebase object is no longer in the global space. See 308a98d

Hmm, before we close this, can we make it available again somehow? It is something very useful to have as the queries we can apply from the UI are very limitaded. Feels like a feature regression losing it, and since it is available in the production Firestore console it feels like a feature mismatch as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

firebase.firestore() is not a function when trying to initialize ...
I fixed it by importing multiple libraries: firebase and firebase/firestore . That's because the firebase core library does not include the ...
Read more >
Upgrade from version 8 to the modular Web SDK - Firebase
The version 9 SDK is optimized to work with modules rather than the browser's window object. Previous versions of the library allowed the...
Read more >
Infinite Pagination in Flutter with Firebase, Riverpod, and ...
Declaring a noMoreItems bool to know when there are no more items to fetch. And the updated UI code: noMoreItems Showing a proper...
Read more >
Jest mock hooks typescript - Details Concept Store
getMockRes will return a mocked res object with Jest mock functions. I'm going to start with a scenario. Inside of this file we'll...
Read more >
globalThis - JavaScript - MDN Web Docs
Unlike similar properties such as window and self , it's guaranteed ... Usually, the global object does not need to be explicitly specified ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found