question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Phantomas npm module returning 0ms domComplete

See original GitHub issue

Thanks for making this awesome tool! I used it for a new project (perfwars.com), and after launching it I realized that a lot of urls return 0ms domComplete, which I had to code a special case and error out for.

in node I’m using these flags with phantomas version 1.12.0 on ubuntu: phantomas(url, {'timeout':30, 'modules': 'windowPerformance', 'stop-at-onload': true}, function(err, json, results) {}

Here’s an example of a url (sas.com) that returns 0ms domComplete about 80% of the time, captured in the console from the node app in debug mode (via DEBUG=phantomas* npm start):

screen shot 2015-10-22 at 8 37 57 pm

As you can see, it returns no errors, yet 0ms domComplete.

After some experimentation, I realized that what was causing this was the “stop-at-onload”: true flag…with that set sometimes onload fires before domComplete (which I would think is the indicator for onload).

Might be a bug, might not, but figured I’d let you know.

UPDATE: After testing more (this time with nytimes.com), even without the stop-at-onload flag, I still get a mix of 0ms domComplete and error code 252

I can also verify the bug when running it straight in the command line:

phantomas http://nytimes.com --reporter=json --modules=windowPerformance

UPDATE2 Here’s some more urls that fail:

apicastor.com app.wlppr.co http://ft.com http://buzzfeed.com http://huffingtonpost.com http://walmart.com

Thanks again! Cory

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
branparcommented, Mar 21, 2017

First off, awesome tool. Starting to work on a project and am integrating this into the toolset. I ran it on a schedule once every 60 seconds for a minute hitting the same URL each time and sending the data to a data warehouse we have onsite for reporting. Of those 60 runs two of them resulted in domComplete to report as 0. So it’s happening for me as well. Two in 60 isn’t major but any fix in progress is appreciated!

1reaction
coryshawcommented, Feb 2, 2016

Just wanted to report back after installing 1.14…this version seems to have significantly reduced the problem. About 90% of the sites that were reporting 0ms DomComplete now work properly. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

phantomas - npm
Headless Chromium-based web performance metrics collector and monitoring tool. Latest version: 2.5.0, last published: 6 months ago.
Read more >
phantomas - npm
phantomas comes as both command line tool and CommonJS module (see API docs) that you can use in your nodejs projects.
Read more >
systeminformation - npm
Advanced, lightweight system and OS information library. Latest version: 5.16.9, last published: 6 days ago. Start using systeminformation ...
Read more >
phantomas - npm
Headless Chromium-based web performance metrics collector and monitoring tool. Latest version: 2.5.0, last published: 4 months ago.
Read more >
node-phantom-simple - npm
This module is API-compatible with node-phantom but doesn't rely on ... (always as the last parameter), instead of returning values.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found