-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation pipeline
-
Iteration Seoul
-
Not Needed
It looks like compass-aggregations imports the compass-logging package which imports mongodb-log-writer which currently assumes it’s being run in an electron environment. This ticket involves updating compass-logging to not import mongodb-log-writer when used in a browser environment.
https://github.com/mongodb-js/compass/blob/main/packages/compass-aggregations/src/modules/create-view/index.js#L1
We check if the environment is currently electron’s renderer, but not if it’s a web environment:
https://github.com/mongodb-js/compass/blob/main/packages/compass-logging/src/index.ts#L30
So we end up requiring mongodb-log-writer which has imports for file writing which would error on browser:
https://github.com/mongodb-js/mongodb-log-writer/blob/main/src/index.ts#L8
Once we've updated it to be used in the browser we should release so the dependency can be updated in cloud (mms).
Down the line we might want to add a browser environment test for compass-aggregations and other shared compass packages to protect against regressions like this.
- related to
-
COMPASS-5405 Add a web browser environment test to compass-aggregations
- Closed