0

If i run the same request in postman it gives me a return in 9 minutes, with a 39mb of json data.

"node-fetch": "^2.6.7"

Same results with
node v16.6.2
node v17.9.1

const fetch = require('node-fetch')

/* 
    This code is inside an async method and inside a try catch block...
    I dont put the rest of code because it dont pass of this line.
    This await fetch is executing for so long time and never ends.
*/
const response = await fetch(requestData.url, requestData.options)

  • Are there any errors in the console? When looking at the Network tab in the Developer console, can you verify that your request goes through? If you try to use cURL (from command line or cmd if you're on Windows) with the same link, do you get anything (JSON should be downloaded)? – FiddlingAway Feb 15 '23 at 17:44
  • @FiddlingAway with cURL is ok i have the same result like the postman, the problem is when i use node-fetch... its run the fetch() and not exit from it... it dont pass for the next line of code, the fetch() command keep running forever... – Artigo 132 Feb 15 '23 at 17:54
  • What about the request itself? Is it visible in your Network tab? The reason I'm asking - check if it's initiated, monitor the Network tab and wait for the request to return a HTTP status code of any kind. If that happens, and your code is still not moving on to the next line, then [this](https://github.com/node-fetch/node-fetch/issues/665) might be related to what you're encountering now. – FiddlingAway Feb 15 '23 at 18:03
  • @FiddlingAway idk i think i have to setting up the http-inspector to see this things. I can't see it in network tab because its not in browser... – Artigo 132 Feb 15 '23 at 18:20
  • Ah, got it. Didn't know you were running it out of a browser. Are there any other, smaller JSONs you could fetch from the same domain? Say, something that's at most 100 or 200 KB? – FiddlingAway Feb 15 '23 at 18:27
  • @FiddlingAway yes i have others endpoints with smaller json data and it works fine in the same domain yeap.... – Artigo 132 Feb 15 '23 at 18:38

0 Answers0