TypeError: Cannot read property 'address' of null
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:3
- Comments:44 (36 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 that0.0.0.0
doesn’t exists on Windows, makeslocalhost
a better candidate in my opinion.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!