-
Notifications
You must be signed in to change notification settings - Fork 2.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
URLSearchParams Error #821
Comments
@karanmartian Can you run this on the page and tell us what it returns please? |
@JakeChampion its returning false, in fetch.umd.js var global = (typeof self !== 'undefined' && self) || (typeof global !== 'undefined' && global); console.log(global); --> false var support = { |
Is that from the |
global |
Oh that is interesting, is this error from a NodeJS application? |
React JS and Node JS yes I have no idea what is modifying it. Can another library influence it? |
Yes, it is a global variable which is meant to point to the global object. We can add a work around in this codebase but really, anything which is making the global variable |
@JakeChampion could you please add the workaround? I dont seem to have another option at this time and I have been stuck at v2.0.4 for a long time now. |
This should fix it for you if you are on NodeJS 12 or higher -- #822 |
@JakeChampion Tysm will there be a new release with this fix? |
Sure thing, in the meantime you can find the culprit modifying the global self variable with this code. Object.defineProperty(window, 'self', {
configurable: true,
enumerable: false,
set: function(value) {
// The delete command removes the setter.
delete window.self;
window.self = value;
debugger;
console.log("self global variable was modified!");
}
}); |
published in 3.4.0 👍 |
tysm @JakeChampion really appreciate it a lot |
Hey Guys, please help after upgrading to latest version of whatwg-fetch v3.3.1
I am seeing this error
TypeError: Cannot use 'in' operator to search for 'URLSearchParams' in false
at /home/karan/Desktop/repos/idwapp/node_modules/whatwg-fetch/dist/fetch.umd.js:10:37
at /home/karan/Desktop/repos/idwapp/node_modules/whatwg-fetch/dist/fetch.umd.js:2:66
at Object. (/home/karan/Desktop/repos/idwapp/node_modules/whatwg-fetch/dist/fetch.umd.js:5:2)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object. (/home/karan/Desktop/repos/idwapp/functions/index.js:1:143379)
error: Forever detected script exited with code: 1
error: Script restart attempt #9
/home/karan/Desktop/repos/idwapp/node_modules/whatwg-fetch/dist/fetch.umd.js:10
searchParams: 'URLSearchParams' in global,
The text was updated successfully, but these errors were encountered: