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.

TypeError: Cannot read property 'address' of null

See original GitHub issue

I’ve started getting this error when running gatsby develop:

error UNHANDLED REJECTION


  TypeError: Cannot read property 'address' of null

  - develop.js:371 _callee3$
    [StateOfJS]/[gatsby]/dist/commands/develop.js:371:38

  - next_tick.js:131 _combinedTickCallback
    internal/process/next_tick.js:131:7

  - next_tick.js:180 process._tickCallback
    internal/process/next_tick.js:180:9

I’m on Mac OS High Sierra with Node 8.9.1. I first got the error while using Node 9 so I downgraded and the error went away, but I noticed that hot module reloading wasn’t working. From reading #864 I got the idea to try gatsby develop --host localhost --port 8000 instead of gatsby develop, but then that triggered the address error again.

I’m not sure what’s going on exactly… Could it be related to my own config somehow?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:44 (36 by maintainers)

github_iconTop GitHub Comments

3reactions
sebastienficommented, Nov 23, 2017

With the latest version atm of Gatsby, Gatsby-cli, running gatsby develop produces : On Windows, a link to localhost is generated, HMR is working, no CORS issue. On Mac, a link to locahost is generated, HMR is broken, CORS issues are showing. After launching the site this way, on Mac if you navigate to 0.0.0.0:8000 then everything works and no CORS.

My 2 cents on this : localhost is more widely supported, and the fact that 0.0.0.0 doesn’t exists on Windows, makes localhost a better candidate in my opinion.

2reactions
yeskunallcommented, Dec 7, 2017

You’re absolutely right. I guess it’s my fault for not looking at the whole thread more carefully. It does work with gatsby@latest. I’d like to point out however, that gatsby-starter-blog is still using v1.9.118, which is why I got that error above. If you’d like, I can make a PR to fix that issue over at gatsbyjs/gatsby-starter-blog!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'address' of undefined supertest - Stack ...
I received a similar error from mocha when testing an express app. Full text of error: 0 passing (185ms) 2 failing 1) loading...
Read more >
TypeError: Cannot read property 'address' of undefined · Issue ...
I created an express.js server with ts and tried to test it, but got an error. I can't find a solution no matter...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
How to deal with TypeError: cannot read properties of null
While coding in Javascript, you must have at least once received a Type Error which has the message “cannot read properties of null”....
Read more >
typeerror can not read property x of null - YouTube
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
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