-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: bson-4.0.2
-
Component/s: BSON
-
None
-
Environment:No transpiling, browser environment, using {{dist/bson.browser.js}}
-
Empty show more show less
From https://github.com/mongodb/js-bson/issues/330 :
Following the instruction in the section "Browser (no bundling)" doesn't work.
On line 3726, "global" is used, which is apparently not defined in browsers.
In Firefox:
ReferenceError: global is not defined bson.bundle.js:3726:6 BSON https://automower2/js/bson.bundle.js:3726 <anonymous> https://automower2/js/bson.bundle.js:9112Chrome has a similar error.
I'm not sure if this deserves a separate issue because it might be related. The "with bundling" section also has the same problem, and it seems the offending lines of code come from elsewhere:
if (typeof global.setTimeout === 'function') { cachedSetTimeout = setTimeout; } if (typeof global.clearTimeout === 'function') { cachedClearTimeout = clearTimeout; }
one more...
var performance = global.performance || {};
- is related to
-
NODE-2712 Incorrect imports in ESM bundle
- Closed