-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
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