fbjs
fbjs copied to clipboard
"global is not defined" in setImmediate.js on v0.8.16
I have the same problem
global got renamed to globalThis in the tc39 proposal
Edit: For what it's worth:
interface Object {
global: object;
globalThis: object;
}
function polyfillGlobalThis ():object {
if (typeof globalThis !== 'undefined') return globalThis
Object.defineProperty(Object.prototype, 'globalThis', {
get: function () {
delete Object.prototype.globalThis
this.globalThis = this
},
configurable: true
})
return globalThis
}
polyfillGlobalThis();
function polyfillGlobal ():object {
if (typeof global !== 'undefined') return global
Object.defineProperty(Object.prototype, 'global', {
get: function () {
delete Object.prototype.global
this.global = this
},
configurable: true
})
return global
}
polyfillGlobal();
probably to fix this issue need to change this line: https://github.com/facebook/fbjs/blob/35d7693c0908820af5a0ed2635dbae45ab6feeb8/packages/fbjs/src/stubs/ErrorUtils.js#L12 to
if (typeof global !== 'undefined' && global.ErrorUtils) {
PR: #355
Any news?
I have the same problem
Me too!
Still an issue, any update?
Same issue
This worked for me.
This worked for me.
This worked but can any one explain what this is doing?
This worked for me.
It does not works in angular + electronJS + contextIsolation = true