firebase / firebase/firebase-tools-ui

logs web viewer crashes while logging large objects

Open
#422 1 comment 0 reactions 1 assignee Claimed by @abeisgoat View on GitHub
Dominant language
TypeScript
Stars
291
Forks
74
PR merge metrics
No merged PRs in 30d

Description

**problem**
Sometimes when I accidentally log bigger objects somewhere in the code of a cloud function (or it has unsafe circular dependencies or something...) - e.g. like here with `logger.info({ req, resp }, `test`);` it causes that the log viewer of firebase emulator (http://localhost:4000/logs) ends in a broken state with a blank screen with this message in the browser's console:

```
react-dom.production.min.js:209 TypeError: Cannot read property 'mode' of undefined
at HighlightedJSON.tsx:131
at Array.map ()
at Hr (HighlightedJSON.tsx:95)
at Qo (react-dom.production.min.js:153)
at ms (react-dom.production.min.js:261)
at cu (react-dom.production.min.js:246)
at su (react-dom.production.min.js:246)
at Zs (react-dom.production.min.js:239)
at react-dom.production.min.js:123
at e.unstable_runWithPriority (scheduler.production.min.js:19)
```

**possible solution**
I would appreciate seeing something more informative - the last thing that it tried to log to the UI (that caused the crash so I can remove it) or just fix of UI because this message is displayed correctly in the terminal (it just has like 50+ rows so it is completely unreadable :-) ) and I also see following `logger.info()` messages under it...

might help - https://www.npmjs.com/package/safe-json-stringify ?

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.