Open
Bug 1476666
Opened 6 years ago
Updated 2 years ago
Confusing/unhelpful error message in Console
Categories
(DevTools :: Console, defect, P2)
DevTools
Console
Tracking
(Not tracked)
NEW
People
(Reporter: janx, Unassigned)
References
Details
Currently, when I navigate to https://firefox-code-coverage.herokuapp.com/#/ I see the following error in the devtools console:
TypeError: r is undefined [learn more] coverage.js:201:6
There is no stack trace, and the file location link takes me to this line:
webpack:///src/utils/coverage.js
201| if (summary.pending === 0) {
There is no `r` variable in the entire file.
As a comparison, Chrome's devtools console shows this error message instead:
Uncaught (in promise) TypeError: Cannot read property 'pending' of undefined
Comment 1•6 years ago
|
||
So there are 3 issues there:
- The message could be better (like chrome one), which is what Bug 1259822 is about
- We reference `r`, which is probably the name of the webpack'd variable. It would be nice to be able to retrieve the original variable name
- There is no stacktrace
Jan, I can't reproduce the issue anymore. Is it me or was it fixed ?
Would you have a link where I can reproduce ? thanks !
Flags: needinfo?(janx)
Priority: -- → P2
Reporter | ||
Comment 2•6 years ago
|
||
The error still reproduces for me in Nightly, but it takes a while (I counted 21 seconds, you have to wait first for initial data to load, then for some additional polling to complete).
It would be nice to extract/reduce the problematic code, or to create a reproducing test case, but I'm not sure how to do either.
Flags: needinfo?(janx) → needinfo?(nchevobbe)
Comment 3•6 years ago
|
||
Thanks Jan, I do see the message as well when waiting for a bit.
For future reference, here's what we get from the server:
```json
{
"from": "server1.conn3.child1/consoleActor2",
"type": "pageError",
"pageError": {
"errorMessage": "TypeError: r is undefined",
"errorMessageName": "JSMSG_UNEXPECTED_TYPE",
"exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Unexpected_type?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default",
"sourceName": "https://firefox-code-coverage.herokuapp.com/index.28f1b6e814e3c9950f13.js",
"lineText": "",
"lineNumber": 58,
"columnNumber": 49548,
"category": "content javascript",
"timeStamp": 1532094691242,
"warning": false,
"error": false,
"exception": true,
"strict": false,
"info": false,
"private": false,
"stacktrace": null,
"notes": null
}
}
```
and indeed there's no stacktraces sent. I'll dig deeper to see why.
Flags: needinfo?(nchevobbe)
Comment 4•6 years ago
|
||
The message we get from the the nsIConsoleService observer [1] does not have the stack property we use to build the error packet (see [2])
[1] https://searchfox.org/mozilla-central/rev/8384a6519437f5eefbe522196f9ddf5c8b1d3fb4/devtools/server/actors/webconsole/listeners.js#70,88
[2] https://searchfox.org/mozilla-central/rev/8384a6519437f5eefbe522196f9ddf5c8b1d3fb4/devtools/server/actors/webconsole.js#1626
Comment 5•6 years ago
|
||
I do reproduce the no stack issue for uncaught promise rejection:
data:text/html,<meta charset=utf8><script>
function a () {b()}
function b() {c();}
function c() {
new Promise(function(resolve,reject){
let x = r.pending;
})}
a();
</script>
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•