Open ValYouW opened 3 months ago
Hi @ValYouW, thank you for raising this issue and sorry for the inconvenience. For esbuild, have you tried to alias the bson to use cjs as below. I've done a quick test in my local environment it seems to resolve this issue. You should also be able to define this from an esconfig file. We had a similar issue during our testing in which we've added an alias to the package.json which fixed this problem for a few other bundling tools, but looks like esbuild doesn't not pick up this from package.json. We are also trying to workout with the bson library team to if there can be a better solution to this.
--alias:bson="./node_modules/bson/lib/bson.cjs"
I had similar issue. I downgraded back to v.3.0.0 and seems it helped to resolve the issue for now.
Same here. Had to downgrade to v3.2.1.
Same here. Had to downgrade to v3.2.1.
Got the same issue with nuxt (vite) :( Had to use https://github.com/Menci/vite-plugin-top-level-await to make it work. Any chance for a fix?
To use version 3.3.1
of mongodb-js/charts-embed-sdk, set the overrides or resolves of bson
in the package.json to force it to use that version
For npm
"overrides": {
"bson": "^4.5.2"
}
For yarn
"resolves": {
"bson": "^4.5.2"
}
After upgrading to version 3.3.1 I started to get the following error when building my code (using esbuild):
It seems the error comes from
bson
lib that was updated in version3.3.1
to^5.4.0
(used to be4.5.2
in3.2.1
)