Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined Realm during import after Version upgrade #6934

Closed
cw-nikhilnaik opened this issue Nov 16, 2024 · 3 comments
Closed

Undefined Realm during import after Version upgrade #6934

cw-nikhilnaik opened this issue Nov 16, 2024 · 3 comments

Comments

@cw-nikhilnaik
Copy link

cw-nikhilnaik commented Nov 16, 2024

How frequently does the bug occur?

Always

Description

We recently bumped up RN version along with realm version, after this we started getting error during import, after careful examination we found out that the package was using "debug" package which was internally giving error where it was imported. On commenting out the debug package references, we were able to run the package successfully. Please tell us the issue

Stacktrace & log output

Can you reproduce the bug?

Always

Reproduction Steps

  1. import Realm from "realm"
  2. Thats it, you will get an error

Version

12.13.1

What services are you using?

Atlas Device Sync

Are you using encryption?

No

Platform OS and version(s)

RN: 0.75.3

Build environment

react: 18.3.1,
react-native: 0.75.3,
realm: 12.13.1,
node: 18.20.2

Cocoapods version

No response

Copy link

sync-by-unito bot commented Nov 16, 2024

➤ PM Bot commented:

Jira ticket: RJS-2922

@cw-nikhilnaik
Copy link
Author

Patch I applied which fixed the problem

Create a patch file as realm+12.13.1.patch

diff --git a/node_modules/realm/dist/debug.js b/node_modules/realm/dist/debug.js
index 504657b6..fb038123 100644
--- a/node_modules/realm/dist/debug.js
+++ b/node_modules/realm/dist/debug.js
@@ -21,12 +21,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
 };
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.extendDebug = exports.debug = void 0;
-const debug_1 = __importDefault(require("debug"));
-/** @internal */
-exports.debug = (0, debug_1.default)("realm");
-/** @internal */
 function extendDebug(namespace) {
-    return exports.debug.extend(namespace);
+    return () => {};
 }
 exports.extendDebug = extendDebug;
 //# sourceMappingURL=debug.js.map
\ No newline at end of file

@kraenhansen
Copy link
Member

I'm still not sure what runtime error you were experiencing nor the cause of it. As such, I'll go ahead and close the issue.
Thanks for sharing your workaround with the community.

@kraenhansen kraenhansen closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants