mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
With mongoexport connecting, every collection then failed with 'parse <coll>: Cannot read properties of undefined (reading parse)' — EJSON was undefined. The importer runs with NODE_PATH=programs/server/node_modules, but the EJSON-bearing bson (7.3.0) lives under programs/server/npm/node_modules, so a bare 'import bson' did not resolve to it and EJSON came out undefined. The mongodb driver (which resolves fine — MongoClient works) bundles bson and re-exports EJSON from lib/bson.js, so take EJSON from the same default import and drop the separate bson dependency. Add an upfront guard that fails loudly if EJSON.parse is ever missing instead of spamming one error per collection. Thanks to xet7.