0
const fetch = require('node-fetch');
const url = 'https://gist.githubusercontent.com/gcollazo/884a489a50aec7b53765405f40c6fbd1/raw/49d1568c34090587ac82e80612a9c350108b62c5/sample.json';
fetch(url)
    .then(res => res.json())
    .then(data => {
        my_data = data;
});

URL is randomly taken from the Internet.

ERROR:

Invalid REPL keyword
>       .then(data => {
Invalid REPL keyword
>               my_data = data;
Thrown:
ReferenceError: data is not defined
> });
Thrown:
});
aste123
  • 1,223
  • 4
  • 20
  • 40
  • The link that has been provided doesn't answer this question. My question is about the error inside the scope. The linked question is about the error outside the scope. Both are completely different. Please reopen. – aste123 Jan 09 '23 at 07:05
  • If you're asking about the "*ReferenceError: data is not defined*", it looks like you tried to enter the code on a REPL line by line. As you can see from the other errors, that didn't work. – Bergi Jan 09 '23 at 10:39

0 Answers0