Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No domContentLoaded event in trace #3838

Closed
dickeylth opened this issue Nov 17, 2017 · 5 comments · Fixed by #5917
Closed

No domContentLoaded event in trace #3838

dickeylth opened this issue Nov 17, 2017 · 5 comments · Fixed by #5917

Comments

@dickeylth
Copy link

I'm using lighthouse for automatic page test, and I've encountered this warning, which makes the performance score very slow, could anyone help to figure out why is this happening?

~/dev/node-test/chrome lighthouse https://h5.m.taobao.com/trip/home/index.html
  ChromeLauncher Waiting for browser. +0ms
  ChromeLauncher Waiting for browser... +1ms
  ChromeLauncher Waiting for browser..... +515ms
  ChromeLauncher Waiting for browser.....✓ +4ms
  status Initializing… +770ms
  status Loading page & waiting for onload URL, Viewport, ViewportDimensions, ThemeColor, Manifest, ChromeConsoleMessages, ImageUsage, Accessibility, EventListeners, AnchorsWithNoRelNoopener, AppCacheManifest, DOMStats, JSLibraries, OptimizedImages, PasswordInputsWithPreventedPaste, ResponseCompression, TagsBlockingFirstPaint, WebSQL +346ms
  statusEnd Loading page & waiting for onload +14s
  status Retrieving trace +1ms
  status Retrieving devtoolsLog and network records +2s
  status Retrieving: URL +14ms
  status Retrieving: Viewport +1ms
  status Retrieving: ViewportDimensions +5ms
  status Retrieving: ThemeColor +6ms
  status Retrieving: Manifest +2ms
  status Retrieving: ChromeConsoleMessages +1ms
  status Retrieving: ImageUsage +2ms
  status Retrieving: Accessibility +59ms
  status Retrieving: EventListeners +262ms
  status Retrieving: AnchorsWithNoRelNoopener +230ms
  status Retrieving: AppCacheManifest +2ms
  status Retrieving: DOMStats +3ms
  status Retrieving: JSLibraries +15ms
  status Retrieving: OptimizedImages +9ms
  status Retrieving: PasswordInputsWithPreventedPaste +161ms
  status Retrieving: ResponseCompression +2ms
  status Retrieving: TagsBlockingFirstPaint +6ms
  status Retrieving: WebSQL +4ms
  status Loading page & waiting for onload ServiceWorker, Offline, StartUrl +811ms
  statusEnd Loading page & waiting for onload +230ms
  status Retrieving devtoolsLog and network records +47ms
  status Retrieving: ServiceWorker +7ms
  status Retrieving: Offline +0ms
  status Retrieving: StartUrl +34ms
  status Loading page & waiting for onload HTTPRedirect, HTMLWithoutJavaScript +333ms
  statusEnd Loading page & waiting for onload +179ms
  status Retrieving devtoolsLog and network records +0ms
  status Retrieving: HTTPRedirect +6ms
  status Retrieving: HTMLWithoutJavaScript +7ms
  status Disconnecting from browser... +5ms
  status Analyzing and running audits... +30ms
  status Evaluating: Uses HTTPS +0ms
  status Evaluating: Redirects HTTP traffic to HTTPS +8ms
  status Evaluating: Registers a service worker +1ms
  status Evaluating: Responds with a 200 when offline +0ms
  status Evaluating: Has a `<meta name="viewport">` tag with `width` or `initial-scale` +1ms
  status Evaluating: Contains some content when JavaScript is not available +2ms
  status Evaluating: First meaningful paint +1ms
  status Evaluating: Page load is fast enough on 3G +125ms
  load-fast-enough-for-pwa:warn Caught exception: No domContentLoaded event in trace +34ms
  status Evaluating: Perceptual Speed Index +0ms
  status Evaluating: Screenshot Thumbnails +2s
  status Evaluating: Estimated Input Latency +187ms
  status Evaluating: No browser errors logged to the console +5ms
  status Evaluating: Keep server response times low (TTFB) +1ms
  status Evaluating: First Interactive (beta) +1ms
  first-interactive:warn Caught exception: No domContentLoaded event in trace +0ms
  status Evaluating: Consistently Interactive (beta) +0ms
  consistently-interactive:warn Caught exception: No domContentLoaded found in trace. +0ms
  status Evaluating: User Timing marks and measures +0ms
  status Evaluating: Critical Request Chains +11ms
  status Evaluating: User can be prompted to Install the Web App +3ms
  status Evaluating: Configured for a custom splash screen +1ms
  status Evaluating: Address bar matches brand colors +0ms
  status Evaluating: Manifest's `short_name` won't be truncated when displayed on homescreen +0ms
  status Evaluating: Content is sized correctly for the viewport +1ms
  status Evaluating: Uses Images with appropriate aspect ratio +0ms
  status Evaluating: Avoids deprecated APIs +2ms
  status Evaluating: Site works cross-browser +0ms
  status Evaluating: Page transitions don't feel like they block on the network +0ms
  status Evaluating: Each page has a URL +0ms
  status Evaluating: `[accesskey]` values are unique. +0ms
  status Evaluating: `[aria-*]` attributes match their roles. +1ms
  status Evaluating: `[role]`s have all required `[aria-*]` attributes. +0ms
  status Evaluating: Elements with `[role]` that require specific children `[role]`s, are present. +0ms
  status Evaluating: `[role]`s are contained by their required parent element. +0ms
  status Evaluating: `[role]` values are valid. +0ms
  status Evaluating: `[aria-*]` attributes have valid values. +0ms
  status Evaluating: `[aria-*]` attributes are valid and not misspelled. +0ms
  status Evaluating: `<audio>` elements contain a `<track>` element with `[kind="captions"]`. +0ms
  status Evaluating: Buttons have an accessible name. +0ms
  status Evaluating: The page contains a heading, skip link, or landmark region. +1ms
  status Evaluating: Background and foreground colors have a sufficient contrast ratio. +0ms
  status Evaluating: `<dl>`'s contain only properly-ordered `<dt>` and `<dd>` groups, `<script>` or `<template>` elements. +0ms
  status Evaluating: Definition list items are wrapped in `<dl>` elements. +0ms
  status Evaluating: Document has a `<title>` element. +0ms
  status Evaluating: `[id]` attributes on the page are unique. +0ms
  status Evaluating: `<frame>` or `<iframe>` elements have a title. +0ms
  status Evaluating: `<html>` element has a `[lang]` attribute. +0ms
  status Evaluating: `<html>` element has a valid value for its `[lang]` attribute. +0ms
  status Evaluating: Image elements have `[alt]` attributes. +0ms
  status Evaluating: `<input type="image">` elements have `[alt]` text. +1ms
  status Evaluating: Form elements have associated labels. +0ms
  status Evaluating: Presentational `<table>` elements avoid using `<th>`, `<caption>` or the `[summary]` attribute. +0ms
  status Evaluating: Links have a discernible name. +0ms
  status Evaluating: Lists contain only `<li>` elements and script supporting elements (`<script>` and `<template>`). +0ms
  status Evaluating: List items (`<li>`) are contained within `<ul>` or `<ol>` parent elements. +0ms
  status Evaluating: The document does not use `<meta http-equiv="refresh">`. +0ms
  status Evaluating: `[user-scalable="no"]` is not used in the `<meta name="viewport">` element and the `[maximum-scale]` attribute is not less than 5. +1ms
  status Evaluating: `<object>` elements have `[alt]` text. +0ms
  status Evaluating: No element has a `[tabindex]` value greater than 0. +0ms
  status Evaluating: Cells in a `<table>` element that use the `[headers]` attribute only refer to other cells of that same table. +0ms
  status Evaluating: `<th>` elements and elements with `[role="columnheader"/"rowheader"]` have data cells they describe. +0ms
  status Evaluating: `[lang]` attributes have a valid value. +0ms
  status Evaluating: `<video>` elements contain a `<track>` element with `[kind="captions"]`. +0ms
  status Evaluating: `<video>` elements contain a `<track>` element with `[kind="description"]`. +0ms
  status Evaluating: Avoids enormous network payloads +0ms
  status Evaluating: Offscreen images +7ms
  offscreen-images:warn Caught exception: No domContentLoaded event in trace +24ms
  status Evaluating: Serve images as WebP +0ms
  status Evaluating: Optimize images +1ms
  status Evaluating: Enable text compression +1ms
  status Evaluating: Properly size images +0ms
  status Evaluating: Avoids Application Cache +17ms
  status Evaluating: Avoids an excessive DOM size +0ms
  status Evaluating: Opens external anchors using `rel="noopener"` +2ms
  status Evaluating: Avoids requesting the geolocation permission on page load +0ms
  status Evaluating: Reduce render-blocking stylesheets +1ms
  status Evaluating: Avoids `document.write()` +0ms
  status Evaluating: Avoids Mutation Events in its own scripts +1ms
  status Evaluating: Avoids front-end JavaScript libraries with known security vulnerabilities +71ms
  status Evaluating: Avoids WebSQL DB +0ms
  status Evaluating: Avoids requesting the notification permission on page load +1ms
  status Evaluating: Allows users to paste into password fields +0ms
  status Evaluating: Reduce render-blocking scripts +0ms
  status Evaluating: Uses HTTP/2 for its own resources +0ms
  status Evaluating: Uses passive listeners to improve scrolling performance +2ms
  status Generating results... +1ms
  Printer domhtml output written to /Users/dickeylth/dev/node-test/chrome/h5.m.taobao.com_2017-11-17_17-15-36.report.html +20ms
  CLI Protip: Run lighthouse with `--view` to immediately open the HTML report in your browser +0ms
  ChromeLauncher Killing Chrome instance 93287 +1ms

You could see there's

  load-fast-enough-for-pwa:warn Caught exception: No domContentLoaded event in trace +34ms
  first-interactive:warn Caught exception: No domContentLoaded event in trace +0ms
  consistently-interactive:warn Caught exception: No domContentLoaded found in trace. +0ms
  offscreen-images:warn Caught exception: No domContentLoaded event in trace +24ms

and the score is really slow:

2017-11-17_17-18-25

which could not reflect the real performance in my opinion.

Looking forward to any help! Thank you.

@patrickhulce
Copy link
Collaborator

This is fascinating @dickeylth thank you so much for filing!

This is the first 100% reproducible example of this error we've seen. The site produces very strange traces. Might need to end up filing a crbug for this.

@dickeylth
Copy link
Author

FYI, plus one more case:

https://h5.m.taobao.com/trip/hotel/search/index.html

~/dev/debug lighthouse https://h5.m.taobao.com/trip/hotel/search/index.html
  ChromeLauncher Waiting for browser. +0ms
  ChromeLauncher Waiting for browser... +1ms
  ChromeLauncher Waiting for browser..... +509ms
  ChromeLauncher Waiting for browser.....✓ +4ms
  status Initializing… +821ms
  status Loading page & waiting for onload URL, Viewport, ViewportDimensions, ThemeColor, Manifest, ChromeConsoleMessages, ImageUsage, Accessibility, EventListeners, AnchorsWithNoRelNoopener, AppCacheManifest, DOMStats, JSLibraries, OptimizedImages, PasswordInputsWithPreventedPaste, ResponseCompression, TagsBlockingFirstPaint, WebSQL +350ms
  Driver:warn Timed out waiting for page load. Moving on... +30s
  statusEnd Loading page & waiting for onload +0ms
  status Retrieving trace +2ms
  status Retrieving devtoolsLog and network records +1s
  status Retrieving: URL +13ms
  status Retrieving: Viewport +1ms
  status Retrieving: ViewportDimensions +4ms
  status Retrieving: ThemeColor +2ms
  status Retrieving: Manifest +2ms
  status Retrieving: ChromeConsoleMessages +1ms
  status Retrieving: ImageUsage +2ms
  status Retrieving: Accessibility +27ms
  status Retrieving: EventListeners +483ms
  status Retrieving: AnchorsWithNoRelNoopener +477ms
  status Retrieving: AppCacheManifest +2ms
  status Retrieving: DOMStats +2ms
  status Retrieving: JSLibraries +46ms
  status Retrieving: OptimizedImages +9ms
  status Retrieving: PasswordInputsWithPreventedPaste +56ms
  status Retrieving: ResponseCompression +2ms
  status Retrieving: TagsBlockingFirstPaint +7ms
  status Retrieving: WebSQL +3ms
  status Loading page & waiting for onload ServiceWorker, Offline, StartUrl +817ms
  statusEnd Loading page & waiting for onload +76ms
  status Retrieving devtoolsLog and network records +28ms
  status Retrieving: ServiceWorker +6ms
  status Retrieving: Offline +1ms
  status Retrieving: StartUrl +6ms
  status Loading page & waiting for onload HTTPRedirect, HTMLWithoutJavaScript +315ms
  statusEnd Loading page & waiting for onload +315ms
  status Retrieving devtoolsLog and network records +0ms
  status Retrieving: HTTPRedirect +10ms
  status Retrieving: HTMLWithoutJavaScript +1ms
  status Disconnecting from browser... +4ms
  status Analyzing and running audits... +40ms
  status Evaluating: Uses HTTPS +1ms
  status Evaluating: Redirects HTTP traffic to HTTPS +6ms
  status Evaluating: Registers a service worker +1ms
  status Evaluating: Responds with a 200 when offline +0ms
  status Evaluating: Has a `<meta name="viewport">` tag with `width` or `initial-scale` +1ms
  status Evaluating: Contains some content when JavaScript is not available +1ms
  status Evaluating: First meaningful paint +1ms
  status Evaluating: Page load is fast enough on 3G +66ms
  load-fast-enough-for-pwa:warn Caught exception: No domContentLoaded event in trace +13ms
  status Evaluating: Perceptual Speed Index +1ms
  status Evaluating: Screenshot Thumbnails +2s
  status Evaluating: Estimated Input Latency +118ms
  status Evaluating: No browser errors logged to the console +4ms
  status Evaluating: Keep server response times low (TTFB) +0ms
  status Evaluating: First Interactive (beta) +1ms
  first-interactive:warn Caught exception: No domContentLoaded event in trace +0ms
  status Evaluating: Consistently Interactive (beta) +0ms
  consistently-interactive:warn Caught exception: No domContentLoaded found in trace. +1ms
  status Evaluating: User Timing marks and measures +0ms
  status Evaluating: Critical Request Chains +6ms
  status Evaluating: User can be prompted to Install the Web App +3ms
  status Evaluating: Configured for a custom splash screen +1ms
  status Evaluating: Address bar matches brand colors +0ms
  status Evaluating: Manifest's `short_name` won't be truncated when displayed on homescreen +1ms
  status Evaluating: Content is sized correctly for the viewport +0ms
  status Evaluating: Uses Images with appropriate aspect ratio +0ms
  status Evaluating: Avoids deprecated APIs +1ms
  status Evaluating: Site works cross-browser +1ms
  status Evaluating: Page transitions don't feel like they block on the network +0ms
  status Evaluating: Each page has a URL +0ms
  status Evaluating: `[accesskey]` values are unique. +0ms
  status Evaluating: `[aria-*]` attributes match their roles. +1ms
  status Evaluating: `[role]`s have all required `[aria-*]` attributes. +0ms
  status Evaluating: Elements with `[role]` that require specific children `[role]`s, are present. +0ms
  status Evaluating: `[role]`s are contained by their required parent element. +0ms
  status Evaluating: `[role]` values are valid. +0ms
  status Evaluating: `[aria-*]` attributes have valid values. +0ms
  status Evaluating: `[aria-*]` attributes are valid and not misspelled. +1ms
  status Evaluating: `<audio>` elements contain a `<track>` element with `[kind="captions"]`. +0ms
  status Evaluating: Buttons have an accessible name. +0ms
  status Evaluating: The page contains a heading, skip link, or landmark region. +0ms
  status Evaluating: Background and foreground colors have a sufficient contrast ratio. +0ms
  status Evaluating: `<dl>`'s contain only properly-ordered `<dt>` and `<dd>` groups, `<script>` or `<template>` elements. +24ms
  status Evaluating: Definition list items are wrapped in `<dl>` elements. +0ms
  status Evaluating: Document has a `<title>` element. +0ms
  status Evaluating: `[id]` attributes on the page are unique. +1ms
  status Evaluating: `<frame>` or `<iframe>` elements have a title. +0ms
  status Evaluating: `<html>` element has a `[lang]` attribute. +0ms
  status Evaluating: `<html>` element has a valid value for its `[lang]` attribute. +0ms
  status Evaluating: Image elements have `[alt]` attributes. +0ms
  status Evaluating: `<input type="image">` elements have `[alt]` text. +0ms
  status Evaluating: Form elements have associated labels. +0ms
  status Evaluating: Presentational `<table>` elements avoid using `<th>`, `<caption>` or the `[summary]` attribute. +1ms
  status Evaluating: Links have a discernible name. +0ms
  status Evaluating: Lists contain only `<li>` elements and script supporting elements (`<script>` and `<template>`). +0ms
  status Evaluating: List items (`<li>`) are contained within `<ul>` or `<ol>` parent elements. +0ms
  status Evaluating: The document does not use `<meta http-equiv="refresh">`. +0ms
  status Evaluating: `[user-scalable="no"]` is not used in the `<meta name="viewport">` element and the `[maximum-scale]` attribute is not less than 5. +0ms
  status Evaluating: `<object>` elements have `[alt]` text. +1ms
  status Evaluating: No element has a `[tabindex]` value greater than 0. +0ms
  status Evaluating: Cells in a `<table>` element that use the `[headers]` attribute only refer to other cells of that same table. +0ms
  status Evaluating: `<th>` elements and elements with `[role="columnheader"/"rowheader"]` have data cells they describe. +0ms
  status Evaluating: `[lang]` attributes have a valid value. +0ms
  status Evaluating: `<video>` elements contain a `<track>` element with `[kind="captions"]`. +0ms
  status Evaluating: `<video>` elements contain a `<track>` element with `[kind="description"]`. +1ms
  status Evaluating: Avoids enormous network payloads +0ms
  status Evaluating: Offscreen images +4ms
  offscreen-images:warn Caught exception: No domContentLoaded event in trace +2ms
  status Evaluating: Serve images as WebP +1ms
  status Evaluating: Optimize images +1ms
  status Evaluating: Enable text compression +1ms
  status Evaluating: Properly size images +0ms
  status Evaluating: Avoids Application Cache +3ms
  status Evaluating: Avoids an excessive DOM size +0ms
  status Evaluating: Opens external anchors using `rel="noopener"` +1ms
  status Evaluating: Avoids requesting the geolocation permission on page load +1ms
  status Evaluating: Reduce render-blocking stylesheets +0ms
  status Evaluating: Avoids `document.write()` +1ms
  status Evaluating: Avoids Mutation Events in its own scripts +0ms
  status Evaluating: Avoids front-end JavaScript libraries with known security vulnerabilities +113ms
  status Evaluating: Avoids WebSQL DB +4ms
  status Evaluating: Avoids requesting the notification permission on page load +0ms
  status Evaluating: Allows users to paste into password fields +1ms
  status Evaluating: Reduce render-blocking scripts +0ms
  status Evaluating: Uses HTTP/2 for its own resources +0ms
  status Evaluating: Uses passive listeners to improve scrolling performance +3ms
  status Generating results... +1ms
  Printer domhtml output written to /Users/dickeylth/dev/debug/h5.m.taobao.com_2017-12-01_17-34-45.report.html +25ms
  CLI Protip: Run lighthouse with `--view` to immediately open the HTML report in your browser +1ms
  ChromeLauncher Killing Chrome instance 26451 +0ms

@paulirish paulirish changed the title first-interactive:warn Caught exception: No domContentLoaded event in trace No domContentLoaded event in trace Jan 16, 2018
@12d
Copy link

12d commented Feb 12, 2018

Here is the cause, browser trys to open anther url before all tracing events are completed. after opening, the trace data is polluted
bug

@jessiehan
Copy link

The same problem with https://m.taobao.com/#index , and this site also tries to open the native url
I think @12d is correct~
So how to fix this problem?

@alekseykulikov
Copy link
Contributor

I've got the same issue when original URL shows an authentication screen then redirects to authentication service then redirects back.

So, there's 2 redirects and 2 trace recordings:

  1. origin loads authentication screen, then redirects to authentication service
  2. (redirect 1) authentication service validates the request and sends credentials to load the origin
  3. origin starts to load

Issue in Lighthouse 2.9.3 is Something went wrong with recording the trace over your page load. Please run Lighthouse again. (NO_DCL)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants