New issue
Advanced search Search tips

Issue 826210 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

In certain circumstances JS console incorrectly renders warning or error messages as colored area without content

Reported by aplimp...@spacebyte.com, Mar 27 2018

Issue description

Chrome Version       : 65.0.3325.181
URLs (if applicable) :
Other browsers tested: N/A

What steps will reproduce the problem?
(1) Problem is difficult to reproduce, happens seemingly randomly

What is the expected result?

When viewing JS console, warnings and errors output with console.warn and console.error shall always display the complete text with the correct color background

What happens instead?

In case of warnings, only a two to five pixel high yellow line is displayed. No content.

In case of errors, a higher red line is displayed. No content

The screenshot "Screen Shot 2018-03-27 at 11.27.06" shows expected behavior. The first time the error messages are displayed ok.

The screenshot "Screen Shot 2018-03-27 at 11.26.34" shows the problem. The second time we run the code, the error messages are no longer displayed. Only a red block is rendered.


 
Screen Shot 2018-03-27 at 11.27.06 .png
51.0 KB View Download
Screen Shot 2018-03-27 at 11.26.34 .png
44.0 KB View Download
Labels: Needs-Triage-M65
Cc: vamshi.kommuri@chromium.org
Components: Platform>DevTools
Labels: Needs-Feedback Triaged-ET
Thanks for filing the issue!

@Reporter: Could you please mention consistent reproducible steps which helps us to triage the issue in a better way. Along with that please Share any test file/URL(if any).

Tentatively adding component "Platform>DevTools" , please change if not applicable.

Comment 3 by kozy@chromium.org, Mar 30 2018

Owner: l...@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 4 by l...@chromium.org, Mar 30 2018

Thanks for the report.  Are you able to provide a JSFiddle or sample file for us to reproduce?

If not,
- Does this reproduce in Chrome Canary, in a Guest/Incognito profile without extensions?
- Does adding and removing a text filter 'fix' the blank warning/error?

Based on the screenshots, I wonder if it's possible that blank red line is not a DevTools error.  The pixel color of the blank red line (~rgb(255, 213, 213) on my screen) doesn't match the red color of the console.errors in the first screenshot (~rgb(255, 240, 240) on my screen).  Is it possible that the site you are inspecting is logging with style formatters?  E.g. console.log('%c foo', 'background: pink') ?
Unfortunately the issue is currently only reproducible on a system I cannot give you access to. I have to see if I can reproduce it in a way that I can share with you.

- Issue CANNOT be reproduced with Chrome Canary (Version 67.0.3384.0 canary (64-Bit)) with standard or incognito Profile. Chrome Canary shows error messages correctly when using same steps that will reproduce the reported error in Chrome.

- In Chrome, Setting and removing a text filter does not cause the errors to display correctly (i.e. does not ‘fix’ the problem)

Regarding the screenshots, what I can say is that the code path executed to create both screenshots is identical. 

When this code runs the first time, the errors are logged correctly. The second time, all we see is the red area. 

To my knowledge we don’t use style formatters. Logging is performed using npm loglevel (https://www.npmjs.com/package/loglevel)

Comment 6 Deleted

Further Info: going back in time, we find that the error does NOT appear in Chrome Version 63.0.3239.132

With 65.0.3325.181 the error appears in Chrome for Windows, in Win 7 and Win 10 (clean install) alike. 

Comment 8 by gilles.l...@lim.eu, Apr 10 2018

I think I have the same issue on Linux with Chrome 65.0.3325.181 (64-bit).

Does NOT happen on Chrome dev 67.0.3386.1.

I got this in my terminal when errors are triggered but not displayed:

[13754:13754:0410/114925.917372:ERROR:CONSOLE(0)] "TypeError: Cannot read property 'addEventListener' of null", source:  (0)
[13754:13754:0410/120753.048151:ERROR:CONSOLE(956)] "NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. Error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
    at HTMLDivElement.Element.insertBefore (chrome-devtools://devtools/bundled/inspector.js:1111:491)
    at Console.ConsoleViewMessage._showRepeatCountElement (chrome-devtools://devtools/bundled/console/console_module.js:355:55)
    at Console.ConsoleViewMessage.incrementRepeatCount (chrome-devtools://devtools/bundled/console/console_module.js:350:49)
    at Console.ConsoleView._tryToCollapseMessages (chrome-devtools://devtools/bundled/console/console_module.js:556:261)
    at Console.ConsoleView._appendMessageToEnd (chrome-devtools://devtools/bundled/console/console_module.js:536:27)
    at Console.ConsoleView._updateMessageList (chrome-devtools://devtools/bundled/console/console_module.js:565:209)
    at Console.ConsoleView._buildHiddenCache (chrome-devtools://devtools/bundled/console/console_module.js:561:34)
    at Console.ConsoleView._onFilterChanged (chrome-devtools://devtools/bundled/console/console_module.js:485:6)
    at Console.ConsoleViewFilter._onFilterChanged (chrome-devtools://devtools/bundled/console/console_module.js:632:53)
    at Common.Object.dispatchEventToListeners (chrome-devtools://devtools/bundled/inspector.js:482:23)", source: chrome-devtools://devtools/bundled/inspector.js (956)
[13754:13754:0410/120804.433129:ERROR:CONSOLE(0)] "TypeError: Cannot read property 'addEventListener' of null", source:  (0)
[13754:13754:0410/120824.409837:ERROR:CONSOLE(1111)] "Uncaught NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.", source: chrome-devtools://devtools/bundled/inspector.js (1111)


I can reproduce this 100% by using console.warn(), console.error() or console.trace() in conditional breakpoints. console.info() works fine though.
BTW, I reproduced it on both Windows and Linux.

Comment 11 by l...@chromium.org, Apr 11 2018

Thanks for the trace in #8, that's helpful.  Commenter #9, #10, do you happen to have a jsfiddle / file we can use to reproduce it on our side?
It should be obvious how to reproduce, but OK, here's your fiddle: https://jsfiddle.net/a0d09hxe/3/

You also need to open the javascript code in the sources panel of devtools and set a conditional breakpoint in the event handler that reads "console.error('From devtools')".

If you click the button a few times, you'll see the error from the code in the fiddle correctly logged and a thin pink line with no text for the error from the conditional breakpoint.

Or just see the attached screenshot.
Conditional-breakpoint-error.png
96.1 KB View Download
Project Member

Comment 13 by bugdroid1@chromium.org, Apr 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/316c04d2df74359631850f75f8344938ea6fac08

commit 316c04d2df74359631850f75f8344938ea6fac08
Author: Erik Luo <luoe@chromium.org>
Date: Fri Apr 13 01:59:29 2018

DevTools: test old regression with OOPIF logs with bad stackTrace

Around M63, logs from OOPIFs contained invalid scriptIds that led to
linkifier failure, preventing users from seeing their logs.

A fix [1] landed to make JSPresentationUtils not throw when linkifier
fails. This CL adds a test.

[1] https://chromium.googlesource.com/chromium/src/+/060e1aacae0500e12dbb746ef4242dc3ec49eadb

Bug:  826210 
Change-Id: Ie343b7927ee15c0def8fc28723b2d763ecad875a
Reviewed-on: https://chromium-review.googlesource.com/1011453
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550473}
[add] https://crrev.com/316c04d2df74359631850f75f8344938ea6fac08/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-bad-stacktrace-expected.txt
[add] https://crrev.com/316c04d2df74359631850f75f8344938ea6fac08/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-bad-stacktrace.js

Comment 14 by l...@chromium.org, Apr 13 2018

Labels: -Needs-Feedback
Status: Fixed (was: Assigned)
Thanks for providing the fiddle, it was helpful in hunting down when it regressed.  I'm able to reproduce the bug on Linux 65.0.3325.181 and it is fixed on 66.0.3359.81.

Bisected the fix to this CL
[1] https://chromium.googlesource.com/chromium/src/+/060e1aacae0500e12dbb746ef4242dc3ec49eadb

In M63~M64, out-of-process-iframes (OOPIFs) were enabled, and some logs from OOPIFs produced bad stackTraces that prevented logs from rendering.  [1] landed a fix, part of M66 and should reach stable soon.  We've added a test case to try to avoid this from happening in the future, since console logs are vital.  Sorry for the inconvenience.
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/316c04d2df74359631850f75f8344938ea6fac08

commit 316c04d2df74359631850f75f8344938ea6fac08
Author: Erik Luo <luoe@chromium.org>
Date: Fri Apr 13 01:59:29 2018

DevTools: test old regression with OOPIF logs with bad stackTrace

Around M63, logs from OOPIFs contained invalid scriptIds that led to
linkifier failure, preventing users from seeing their logs.

A fix [1] landed to make JSPresentationUtils not throw when linkifier
fails. This CL adds a test.

[1] https://chromium.googlesource.com/chromium/src/+/060e1aacae0500e12dbb746ef4242dc3ec49eadb

Bug:  826210 
Change-Id: Ie343b7927ee15c0def8fc28723b2d763ecad875a
Reviewed-on: https://chromium-review.googlesource.com/1011453
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550473}
[add] https://crrev.com/316c04d2df74359631850f75f8344938ea6fac08/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-bad-stacktrace-expected.txt
[add] https://crrev.com/316c04d2df74359631850f75f8344938ea6fac08/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-bad-stacktrace.js

Sign in to add a comment