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
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.
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.
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 .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With