You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 22, 2025. It is now read-only.
I wish the steps to get here were smaller, of course, but it's quite easy to run, or just read on:
rxjs/util/root.js:11: ERROR - The body of a goog.module cannot use throw.
throw new Error('RxJS could not find any global context (window, self, global)');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That file, emitted by tsickle:
goog.module('rxjs.util.root'); exports = {}; var module = {id: 'rxjs/util/root.js'};
/**
* window: browser in DOM main thread
* self: browser in WebWorker
* global: Node.js/other
*/
exports.root = (typeof window == 'object' && window.window === window && window
|| typeof self == 'object' && self.self === self && self
|| typeof global == 'object' && global.global === global && global);
if (!exports.root) {
throw new Error('RxJS could not find any global context (window, self, global)');
}
//# sourceMappingURL=root.js.map
I'm not sure where to go from here, but if I make the assumption "the goal of tsickle is to take most valid TypeScript code and make it valid properly typed Closure code", then the above seems like a bug or missing feature in tsickle. With that fig leaf as an excuse to enter this as an issue... here's what I'm trying to figure out:
Any pointer in the right direction to work toward tsickling RxJS?
Might I need to rearrange RxJS to somehow avoid problematic throw?
Manually convert a module or two to get past this limitation?
Beg the Closure team to support throw inside goog.modules?
Make tsickle emit ES2015 modules with type comments, which Closure can (?) recently consume, perhaps without this throw limitation?
Decide instead that some libraries are too painful to tsickle, and consume them in Closure as ES2015 and without full typing?