Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2476

GridFS stream different BSON module resolving on browser and server dev processes

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.5.2, 3.5.4
    • Component/s: BSON, Core
    • Environment:
      mongodb: 3.5.4
      nextron: 5.14.4
      react: 16.12.0
      webpack: 4.41.5
    • Not Needed
    • 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?

      Main package stack:

      • mongodb: 3.5.4
      • nextron: 5.14.4
      • react: 16.12.0
      • webpack: 4.41.5

       I tried to store some file by GridFs stream, I have error:

      core.BSON.ObjectId is not a function
       at new GridFSBucketWriteStream (upload.js:43)
       at GridFSBucket.../node_modules/mongodb/lib/gridfs-stream/index.js.GridFSBucket.openUploadStream (index.js:95) 

      I had investigated this error and found interesting thing, module bson isn`t resolve by node_modules/bson/index.js file when I use browser app (electron/nextron) and it isn`t has alias for Object+ID+.

      Also I run same code via jest test and everything is working properly and module bson resolved correctly and has alias for Object+ID+

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            basman9911@gmail.com Дима Николаев
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: