sitespeedio / sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.
https://www.sitespeed.io/
MIT License
4.74k stars 601 forks source link

Cannot read property 'name' of undefined occurring on Chrome on 14.2.3 but not 14.2.1 #3128

Closed shaqb closed 4 years ago

shaqb commented 4 years ago

When I'm running a test docker run --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:14.2.3 https://www.ryanair.com --browsertime.connectivity.engine tsproxy --browsertime.connectivity.profile cable I get the following error:

ERROR: TypeError: Cannot read property 'name' of undefined
    at /usr/src/app/node_modules/chrome-har/lib/entryFromResponse.js:49:36
    at Array.find (<anonymous>)
    at /usr/src/app/node_modules/chrome-har/lib/entryFromResponse.js:48:51
    at Array.filter (<anonymous>)
    at module.exports (/usr/src/app/node_modules/chrome-har/lib/entryFromResponse.js:46:25)
    at Object.harFromMessages (/usr/src/app/node_modules/chrome-har/index.js:392:15)
    at ChromeDelegate.onCollect (/usr/src/app/node_modules/browsertime/lib/chrome/webdriver/chromeDelegate.js:390:31)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Measure.collect (/usr/src/app/node_modules/browsertime/lib/core/engine/command/measure.js:378:5)
    at async /usr/src/app/node_modules/browsertime/lib/core/engine/run.js:9:9
    at async Iteration.run (/usr/src/app/node_modules/browsertime/lib/core/engine/iteration.js:192:9)
    at async Engine.runByScript (/usr/src/app/node_modules/browsertime/lib/core/engine/index.js:174:20)
    at async Object.analyzeUrl (/usr/src/app/lib/plugins/browsertime/analyzer.js:124:21)
    at async Object.processMessage (/usr/src/app/lib/plugins/browsertime/index.js:134:24)
[2020-08-17 14:14:43] ERROR: TypeError: Cannot read property 'length' of undefined
    at Collector.perIteration (/usr/src/app/node_modules/browsertime/lib/core/engine/collector.js:116:31)
    at Engine.runByScript (/usr/src/app/node_modules/browsertime/lib/core/engine/index.js:178:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.analyzeUrl (/usr/src/app/lib/plugins/browsertime/analyzer.js:124:21)
    at async Object.processMessage (/usr/src/app/lib/plugins/browsertime/index.js:134:24)
[2020-08-17 14:14:44] INFO: HTML stored in /sitespeed.io/sitespeed-result/www.ryanair.com/2020-08-17-14-14-29

However when I roll back to version 14.2.1 I do not see this issue. I also don't see this on Firefox on 14.2.3. Looking at the release notes, it appears there has been a change to the version of Browsertime (9.2.1) which could narrow down the root cause.

I am using docker on macOS Catalina 10.15.6.

soulgalore commented 4 years ago

Hi @shaqb thanks for creating the issue. There was a fix in Chrome-HAR that I think solves that issue (introduced a version earlier), I'm gonna push a new sitespeed.io release tomorrow where that's included.

If you have time to try out the unreleased version (use sitespeedio/sitespeed.io-autobuild) then you can help me verify that it works? When I tried on my local machine it worked but I got redirected to the Swedish version of the site so maybe I got other content.

shaqb commented 4 years ago

Hi @soulgalore - just gave it a whirl with the unreleased version and it's back to working perfectly. Nice job!

soulgalore commented 4 years ago

Great, thanks for testing! I've just pushed that in 14.3.0.