Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see what's <omitted> in Chrome debug console

I am using Knockout.js, and the most important part of the error message is (nowadays) often hidden under the <omitted> part. I tried hovering over, and clicking a lot of stuff, but I can't find a way to see the full message. Does anyone have a tip?

Thanks in advance!

PS: I'm looking for a fix within the Chrome settings. So without cluttering my code with extra window.onerror stuff or otherwise. I don't want to clutter my code just because the Chrome development team thought it was a good idea to omit debug text :S

For a code hack, see this answer: https://stackoverflow.com/a/22218280/647845

enter image description here

like image 424
Dirk Boer Avatar asked Mar 20 '14 08:03

Dirk Boer


People also ask

How do I show hidden errors in console?

Even after checking the 'Errors' under 'Default', I was not able to see the errors in the console. I then navigated to settings (or press F1 ) and on the bottom of the page, you will see 'Restore defaults and reload' option. After restoring to defaults, I am able to see the console errors. Save this answer.

How do I find unused codes in Chrome?

The Coverage tab in Chrome DevTools can give you a line-by-line breakdown of unused code. The Coverage class in Puppeteer can help you automate the process of detecting unused code and extracting used code.

How do I view Chrome console history?

Click the Console tab. Press Control + [ or Command + [ (Mac) until the Console is in focus. Open the Command Menu, start typing Console , select the Show Console Panel command, and then press Enter .


1 Answers

Here's a little bit of code that will output the whole error message:

window.onerror = function (errorMsg, url, lineNumber, columnNumber, errorObject) {
    if (errorObject && /<omitted>/.test(errorMsg)) {
        console.error('Full exception message: ' + errorObject.message);
    }
}

You can execute this in the development console in Chrome, so it doesn't have to be in the actual code of your web page.

like image 155
Michael Best Avatar answered Sep 28 '22 05:09

Michael Best