-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot make a node-fetch request, TypeError: Cannot read property 'Symbol(requestOptions)' of undefined #36364
Comments
I'm having some difficulty reproducing this: ❯ cat index.js const fetch = require('node-fetch');
(async () => {
const response = await fetch('https://api.github.com/users/github');
const json = await response.json();
console.log(json);
})(); ❯ node index.js &> /dev/null
❯ echo $?
0
❯ node -v
v15.2.0
❯ uname -a
Linux hp 4.15.0-124-generic #127-Ubuntu SMP Fri Nov 6 10:54:24 UTC 2020 i686 i686 i686 GNU/Linux As you can see, it exits with a zero error code. |
I tracked down the issue and found out that one of the libs in the project, was defining methods on Object and Array Prototype. |
This may be due to expanded use of what we call |
Though it looks like @targos has already self-assigned this so they probably have a good idea what the bug is and what the fix is. |
To explain the bug: there was a semver-minor change that introduced a |
What steps will reproduce the bug?
Any call to foreign api, using a trusted library like "node-fetch", creates error and crash servers, on versions higher than 12.18
Here is the error:
How often does it reproduce? Is there a required condition?
All the time, not in version 12.18 or lower
What is the expected behavior?
a normal fetch, returning the result from any api, mostly a json
What do you see instead?
app crashes!
Additional information
The text was updated successfully, but these errors were encountered: