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

first-contentful-paint.js: Cannot read property 'startTime' of undefined #11

Open
nucliweb opened this issue Jun 14, 2020 · 1 comment

Comments

@nucliweb
Copy link
Contributor

I can't see the problem, but I have an error running the script first-contentful-paint.js.

Error

➜ node first-contentful-paint.js
First paint: 111.78500001551583
(node:4558) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startTime' of undefined
    at /Users/joan.leon/projects/PerfReviews/.../puppeteer-webperf/first-contentful-paint.js:24:55
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:4558) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4558) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I have try to print the firstContentfulPaint value, and he has an empty array.

➜ node first-contentful-paint.js
firstContentfulPaint: []
First paint: 113.004999991972
``
@MichaelDurfey
Copy link

This might have happened because your navigation event is not waiting for the page to be fully loaded. Try this page.goto(url, { waitUntil: 'networkidle2' }), or you could try networkidle0

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

No branches or pull requests

2 participants