-
Type: Bug
-
Resolution: Duplicate
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
https://github.com/mongodb/js-bson/releases/tag/v4.4.1
BSON operates differently on node, than it does in the browser. 4.4.1 breaks it's use in the browser node specific calls. 4.4.0 is fine so the problem is a new one.
It makes a new call to global.performance which of course can not work, since the browser doesn't have global.
It not only in the default, but is you specifically import the esm browser only version
import BSON from 'bson/dist/bson.browser.esm';
It is still there.
Weirdly enough.... importing the umd version does not have it.
Steps to reproduce: just import it, it will break before you even make a call.
I SUSPECT it is a side effect of https://jira.mongodb.org/browse/NODE-3376 since it has some changes in how the builds work.
Acceptance Criteria
- Make bson.browser.esm.js work in the browser.
- We should consider filing an additional ticket to create infrastructure for testing this work - implementing the infrastructure should not be handled as part of this ticket.
- duplicates
-
NODE-3527 BSON npm package does not work when using as a ESM
- Closed