GoogleChrome / GoogleChrome/lighthouse

Errors in console audit - url field is undefined for certain browser console errors

Open
#12,987 2 comments 0 reactions 1 assignee Claimed by @connorjclark View on GitHub
needs-investigation P2
Dominant language
JavaScript
Stars
30.8k
Forks
9.8k
Avg merge
1d 20h
Merged PRs (30d)
19

Description

**Summary**
While running [error-in-console](https://web.dev/errors-in-console/) audit on certain pages we do see that the source `URL` field is missing which should have been returned as part of the item details. Also from the dev tools, I see that [URL is an optional field](https://chromedevtools.github.io/devtools-protocol/v8/Runtime/#type-ExceptionDetails) that would not be returned by the LH (URL in the ExceptionDetails object). I am wondering why for certain browser console errors this might happen.
I am arriving at the conclusion that if the errors are caused due to a 3rd party API ,the URL field is not returned. But would be great to know the actual reason why the `URL` field is not returned.

Few examples are below:
1. Running this audit against - https://info.rippleit.com/book-a-30-minute-strategy-session
```
"items": [
{
"source": "security",
"description": "[Report Only] Refused to frame 'https://app.hubspot.com/' because an ancestor violates the following Content Security Policy directive: \"frame-ancestors 'self'\".\n"
}
]
```
2. https://www.thinkwhy.com/news-detail/the-recovery-begins/
```
"items": [
{
"source": "exception",
"description": "TypeError: Cannot read property 'split' of undefined\n at :1:496\n at :2:210"
}
]
```
Issues that I found related to the above:
1. https://bugs.chromium.org/p/chromium/issues/detail?id=1074317&q=sourceUrl&can=1

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.