-
Type: Build Failure
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: bson-6.3.0
-
Component/s: BSON
When importing bson into an async function, NextJS throws an error stating:
//
⨯ node_modules/bson/lib/bson.mjs (131:26) @ eval
⨯ ReferenceError: await is not defined
at __webpack_require__ (/Users/somnus/WebstormProjects/nextjs-playground/.next/server/webpack-runtime.js:33:43)
at eval (./src/lib/updateMongoOrder.ts:11:62)
at (action-browser)/./src/lib/updateMongoOrder.ts (/Users/somnus/WebstormProjects/nextjs-playground/.next/server/app/[orgSlug]/order/[id]/page.js:535:1)
at Function.__webpack_require__ (/Users/somnus/WebstormProjects/nextjs-playground/.next/server/webpack-runtime.js:33:43)
- is related to
-
NODE-3376 Node.js BSON dist cannot serialize browser BSON dist ObjectId
- Closed
-
NODE-6301 bson node es6 module import issue inside react app
- Closed
-
NODE-4211 "bson" package: Browser shouldn't require("crypto")
- Closed
-
NODE-6623 BSON exports causing confusion
- Investigating
-
NODE-5773 Cant use BSON ObjectId in browser
- Closed
- related to
-
NODE-5152 Remove RequireRewriter rollup transformer
- Closed
-
NODE-6321 Remove import of crypto from js-bson
- Blocked
-
NODE-5773 Cant use BSON ObjectId in browser
- Closed