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

bson package breaks expo 48 build and crashes expo 49 apps

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • 2
    • 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

      Summary

      The javascript bson package makes builds in expo 48 (react-native 0.71.x) fail and crashes expo 49 (react native 0.72.x). It seems to be related to some node stuff.

      The docs of the bson-js package provide guidance on how to use bson in react-native applications, which i applied but they do not solve the issue. The error logs let me assume that node internals are not polyfilled correctly or not at all.

      Environment

      expo 48 / react-native 0.71

      expo 49 / react-native 0.72

      EAS build with default machine settings

      How to Reproduce

      - Create an expo project using eas cli with expo 49 and react native 0.72.x

      _- use bson package as described in react-native readme section of https://github.com/mongodb/js-bson_

      Additional Background

      Logs:

      ```
      [stderr] /home/expo/workingdir/build/apps/xxx/android/app/build/generated/assets/createBundleReleaseJsAndAssets/index.android.bundle:2502:18: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow"

      2067[stderr] {{ typeof DebuggerInternal !== 'undefined' &&}}

      2068[stderr] {{ ^~~~~~~~~~~~~~~~}}

      2069[stderr] /home/expo/workingdir/build/apps/xxxx/android/app/build/generated/assets/createBundleReleaseJsAndAssets/index.android.bundle:11172:7: warning: the variable "setTimeout" was not declared in function "logCapturedError"

      2070[stderr] {{ setTimeout(function () {}}

      2071[stderr] {{ ^~~~~~~~~~}}

      2072[stderr] /home/expo/workingdir/build/apps/xxxx/android/app/build/generated/assets/createBundleReleaseJsAndAssets/index.android.bundle:9132:108: warning: the variable "nativeFabricUIManager" was not declared in function "onChange"

      2073[stderr] ...lInstanceHandle ? (from && nativeFabricUIManager.setIsJSResponder(from.sta...

      2074[stderr] {{ ^~~~~~~~~~~~~~~~~~~~~}}

            Assignee:
            warren.james@mongodb.com Warren James
            Reporter:
            hello@valentin-rapp.de Valentin Rapp
            None
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: