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.

3.0.0 beta.10: TypeError: Cannot read property 'body' of null

See original GitHub issue
import fetch from 'node-fetch'

const response = await fetch('https://blog.logrocket.com/feed')
const body = await response.text()

console.log(body)

throws

file:///root/fetchbug/node_modules/node-fetch/src/index.js:99
			response.body.destroy(error);
			         ^

TypeError: Cannot read property 'body' of null
    at file:///root/fetchbug/node_modules/node-fetch/src/index.js:99:13
    at TLSSocket.<anonymous> (file:///root/fetchbug/node_modules/node-fetch/src/index.js:310:6)
    at TLSSocket.emit (events.js:327:22)
    at net.js:673:12
    at TCP.done (_tls_wrap.js:563:7)
software version
node-fetch 3.0.0-beta.10
node v14.16.0
npm 7.17.0
Operating System archlinux

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
tekwizcommented, Jul 26, 2021

@jimmywarting I’ll take a look at this today.

0reactions
tekwizcommented, Jul 26, 2021

@jimmywarting See #1222 for fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'body' of null - Stack Overflow
To fix this you should use a package that isn't deprecated and make sure you are trying to fetch a resource that you...
Read more >
jest typeerror: cannot read properties of null (reading 'usestate')
Invalid hook call. Hooks can only be called inside of the body of a function component. TypeError: Cannot read properties of null (reading...
Read more >
Changelog - Cypress Documentation
We fixed a regression in 3.6.0 where Cypress would crash with TypeError: Cannot read property 'length' of null on some network requests. Fixes...
Read more >
Cannot read property 'medium' of null" Cant figure it out! - Reddit
I think this means that the data hasn't been loaded yet so to fix this u can add { medium && medium.map.... }....
Read more >
How to Build a Full Stack NFT Marketplace - V2 (2022)
Oct 21 '21 • Edited on Mar 10 ... node-fetch <=2.6.0 || 3.0.0-beta.1 - 3.0.0-beta.8 ... TypeError: Cannot read property '2' of undefined....
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