Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-2424

[expo] While trying to resolve module `realm` from file

      How frequently does the bug occur?

      Always

      Description

      RN: 0.72.0-rc.5
      Expo: ~49.0.0-alpha.4

      There's a bug issue:

      BUNDLE  ./index.js
      
      error: Error: While trying to resolve module `realm` from file `/Users/<appName>/app/src/storage/realm/index.ts`, the package `/Users/<appName>/app/node_modules/realm/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/<appName>/app/node_modules/realm/dist/bundle.react-native.mjs`. Indeed, none of these files exist:
      
       * /Users/<appName>/app/node_modules/realm/dist/bundle.react-native.mjs(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.svg|.native.svg|.svg)
       * /Users/<appName>/app/node_modules/realm/dist/bundle.react-native.mjs/index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.svg|.native.svg|.svg)
         at DependencyGraph.resolveDependency (/Users/<appName>/app/node_modules/metro/src/node-haste/DependencyGraph.js:289:17)
      

      Here my file:

      import Realm from 'realm';
      
      export class RealmStorage {
        private realm!: Realm;
      ...
      }
      
      

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Always

      Reproduction Steps

      • Run metro start
      • Waiting bundling
      • Error in index.js

      Version

      12.0.0-alpha.2

      What services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      MacOs

      Build environment

      Which debugger for React Native: ..

      Cocoapods version

      No response

            Assignee:
            kraen.hansen@mongodb.com Kræn Hansen
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: