bson libruary can't be used

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • 1
    • Not Needed
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      https://github.com/mongodb/js-bson#bugs--feature-requests

      npm install bson

      then:

      import

      { BSON, EJSON, ObjectId }

      from 'bson';

       

      When in node app I am using "bson" library, this is error I get:

      node app.js
      .../src/node_modules/bson/lib/bson.mjs:95
      const nodejsRandomBytes = await (async () => {
                                                              ^^^^^

      SyntaxError: Unexpected reserved word
          at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)

            Assignee:
            Neal Beeken
            Reporter:
            Nego Yoir
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: