sindresorhus / speed-test

Test your internet connection speed and ping using speedtest.net from the CLI
MIT License
3.91k stars 164 forks source link

Cannot read property 'settings' of null #27

Closed meeDamian closed 8 years ago

meeDamian commented 8 years ago
  1. Instal/update,
  2. Run speed-test,
  3. See:
speed-test

      Ping ⠹
  Download
    Upload
events.js:141
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'settings' of null
    at gotServers (/usr/local/lib/node_modules/speed-test/node_modules/speedtest-net/index.js:522:20)
    at /usr/local/lib/node_modules/speed-test/node_modules/speedtest-net/index.js:48:16
    at /usr/local/lib/node_modules/speed-test/node_modules/speedtest-net/index.js:238:7
    at Parser.<anonymous> (/usr/local/lib/node_modules/speed-test/node_modules/xml2js/lib/xml2js.js:483:18)
    at emitOne (events.js:77:13)
    at Parser.emit (events.js:169:7)
    at Parser.exports.Parser.Parser.parseString (/usr/local/lib/node_modules/speed-test/node_modules/xml2js/lib/xml2js.js:493:16)
    at Parser.parseString (/usr/local/lib/node_modules/speed-test/node_modules/xml2js/lib/xml2js.js:7:59)
    at exports.parseString (/usr/local/lib/node_modules/speed-test/node_modules/xml2js/lib/xml2js.js:534:19)
    at /usr/local/lib/node_modules/speed-test/node_modules/speedtest-net/index.js:236:5

seems like a bug caused by a change in https://github.com/ddsol/speedtest.net . I'd say it's either https://github.com/ddsol/speedtest.net/commit/8f53240a4e561f1dc1bd4f91bc098d3d64f674a9 or https://github.com/ddsol/speedtest.net/commit/dce7e7d93d24ebe0e1a3f48c1cc1fddd7cfc0959

sindresorhus commented 8 years ago

// @ddsol

mbenedettini commented 8 years ago

It's a problem with the servers url, changing it from http://www.speedtest.net/speedtest-servers-static.php to http://www.speedtest.net/speedtest-servers.php in https://github.com/ddsol/speedtest.net/blob/master/index.js#L481 solves the issue. Also https://www.speedtest.net/speedtest-servers-static.php works (https).

ddsol commented 8 years ago

I fixed it and bumped the version. Thanks for the debug.

irvingswiftj commented 8 years ago

upgrading to 1.2.4 resolved this for me

ngryman commented 8 years ago

Hi, it seems I have the same issue with version 1.7.0.

image

susfly commented 8 years ago

image Hi all, I got the same problem...version 1.7.0

susfly commented 8 years ago

@ngryman Change serversurl to https://www.speedtest.net/speedtest-servers-static.php can make it. ^_^

Restuta commented 8 years ago

@sindresorhus it's again happening with 1.6.1 and 1.7.0 with node 6.5.0. Mb reopen?

Restuta commented 8 years ago

@susfly how would I change the url?

ddsol commented 8 years ago

Just edit this line.