realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.81k stars 577 forks source link

Unable to resolve "../../../realm/lib/browser$1" from "node_modules/@realm/react/dist/index.cjs" #6793

Open seansongss opened 4 months ago

seansongss commented 4 months ago

How frequently does the bug occur?

Always

Description

Realm worked fine but since updating to new version it gives error. I am using Expo with npm and have version of "realm": "^12.11.1", "@realm/react": "^0.8.0", "expo": "^51.0.20".

Stacktrace & log output

Unable to resolve "../../../realm/lib/browser$1" from "node_modules/@realm/react/dist/index.cjs"

Can you reproduce the bug?

Always

Reproduction Steps

npm run or npm run ios both fails to load the app

Version

12.11.1

What services are you using?

Atlas Device Sync

Are you using encryption?

-- select --

Platform OS and version(s)

ios

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

sync-by-unito[bot] commented 4 months ago

➤ PM Bot commented:

Jira ticket: RJS-2864

kraenhansen commented 4 months ago

What package did you upgrade and from what version? Also, can you share your Metro config? I'm interested in learning if you have special configuration for the resolver.

seansongss commented 4 months ago

// Learn more https://docs.expo.dev/guides/customizing-metro const { getDefaultConfig } = require('expo/metro-config');

module.exports = getDefaultConfig(__dirname);

this is my metro.config.js which I directly copied from the Expo example.

I have upgraded @realm/react from 0.7.0 to 0.8.0 and it is causing me the error message. When I run through simulator, it gives none of the files exist in the path. Now I have downgraded to 0.7.0 which works perfectly fine.