[Browser Console] Panel Crashed with 'TypeError: can't access property "level", message is undefined'
Categories
(DevTools :: Console, defect)
Tracking
(firefox110 fixed)
Tracking | Status | |
---|---|---|
firefox110 | --- | fixed |
People
(Reporter: jdescottes, Assigned: nchevobbe)
References
Details
Attachments
(1 file)
I had a crash of the Browser Console, but I didn't see the crash immediately. I forgot the Browser Console was in the background, only saw the issue a few hours later.
Afterwards, I opened the Browser Toolbox to see if there were any messages around the time of the crash which could help identify the source, but there are no messages really close to the crash. The logs before and after both relate to chat.mozilla.org (so matrix), but they are minutes away from the crash, so it's not a strong indication.
getWarningGroupType@resource://devtools/client/webconsole/utils/messages.js:713:5
isMessageInWarningGroup@resource://devtools/client/webconsole/selectors/messages.js:70:8
renderMessage@resource://devtools/client/webconsole/components/Output/ConsoleOutput.js:302:15
render@resource://devtools/client/webconsole/components/Output/LazyMessageList.js:347:21
finishClassComponent@resource://devtools/client/shared/vendor/react-dom.js:10638:31
updateClassComponent@resource://devtools/client/shared/vendor/react-dom.js:10601:44
beginWork@resource://devtools/client/shared/vendor/react-dom.js:11419:16
performUnitOfWork@resource://devtools/client/shared/vendor/react-dom.js:14702:12
workLoop@resource://devtools/client/shared/vendor/react-dom.js:14720:24
renderRoot@resource://devtools/client/shared/vendor/react-dom.js:14803:15
performWorkOnRoot@resource://devtools/client/shared/vendor/react-dom.js:15655:17
performWork@resource://devtools/client/shared/vendor/react-dom.js:15567:24
performSyncWork@resource://devtools/client/shared/vendor/react-dom.js:15541:14
requestWork@resource://devtools/client/shared/vendor/react-dom.js:15410:5
scheduleWork@resource://devtools/client/shared/vendor/react-dom.js:15224:16
enqueueForceUpdate@resource://devtools/client/shared/vendor/react-dom.js:8225:17
Component.prototype.forceUpdate@resource://devtools/client/shared/vendor/react.js:346:16
#scrollHandler@resource://devtools/client/webconsole/components/Output/LazyMessageList.js:261:12
React Component Stack
componentStack
in LazyMessageList
in div
in ConsoleOutput
in VisibilityHandler
in Unknown
in Connect(Component)
in div
in div
in App
in VisibilityHandler
in Unknown
in Connect(Component)
in AppErrorBoundary
in LocalizationProvider
in Provider
in Provider
Reporter | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Here's what the stack suggests
In ConsoleOutput#renderMessage
, we are using the passed message id to retrieve it and then calling isMessageInWarningGroup
(only possible as there is at least one warning group)
const renderMessage = (messageId, index) => {
...
inWarningGroup:
warningGroups && warningGroups.size > 0
? isMessageInWarningGroup(
mutableMessages.get(messageId),
visibleMessages
)
: false,
isMessageInWarningGroup
doesn't do much and only calls getWarningGroupType
for the message
function isMessageInWarningGroup(message, visibleMessages = []) {
if (!getWarningGroupType(message)) {
then in getWarningGroupType
there's an exception as we expect message
to be an object
function getWarningGroupType(message) {
if (
message.level !== MESSAGE_LEVEL.WARN &&
but in this case message
is undefined
, and so this means that the earlier mutableMessages.get(messageId)
returned undefined
, meaning that messageId
isn't in the Map.
At this point I can really tell why, we may have some race condition where the message is removed from the Map but we are still trying to render it, or it could be some mismatch between mutableMessages
and mutableMessagesOrder
Assignee | ||
Comment 2•2 years ago
|
||
This should prevent to crash the browser until we find out
why this function is called with undefined.
Updated•2 years ago
|
Comment 4•2 years ago
|
||
bugherder |
Assignee | ||
Updated•2 years ago
|
Description
•