Not sure whether this is a VS code issue or a realm issue. When I debug my app using VS code, I get the following error. I see that all the other modules under node_modules/realm/lib are loaded properly but not submit-analytics.js. Let me know if you need more details.
Unknown named module: './submit-analytics'
_require
require.js:93:12
nodeRequire
index.js:23:11
<unknown>
index.js:70:8
loadModuleImplementation
require.js:171:4
guardedLoadModule
require.js:123:11
_require
require.js:107:6
<unknown>
db.js:1
loadModuleImplementation
require.js:171:4
guardedLoadModule
require.js:123:11
_require
require.js:107:6
+1
Hi @sparameshwar (and @avishayil). Thanks for reporting this. Someone will review what you've shared and follow-up with you soon with more information and/or questions. Cheers!
I found the error in realm/lib/index.js
as about line 21 "function getContext()"
The function returned "nodejs". but not "reactnative"
It's a new issue after VSCode 1.9.1 updated.
I were pull a request to fix VS Code crash issue in VSCode 1.9, but it's not working 1.9.1 now.
I have figure out how to fix the getContext, but met another issue.
More information here: https://github.com/realm/realm-js/pull/855
I think realm-js should implement data request asynchronous.
VSCode 1.9.1 fast fix by mongers: https://github.com/realm/realm-js/pull/855#issuecomment-282658385.
Thoughts:
Technically, you can safely delete submit-analytics, except it is the key symptom in our case :)
Regarding platform detection heuristics, there is a branch for that: https://github.com/realm/realm-js/commit/f6347cf59fd71f90723f38f63152418ab642f348
I'll be happy if you'll find some regressions there.
Synchronous requests are kind of problematic, because Realm access model is exclusively synchronous (it is a very fast embedded mmap'ed database). That causes some difficulties when the js environment runs separately from the native env (#491).
Deleting submit-analytics didnt work. I now get an error: "Unknown named module: './submit-analytics'". Reopening the issue. It will be good to have a build that fixes the issue.
I cant seem to reopen the issue. @gritzko - can you help reopen it?
@sparameshwar did you use the VS Code fast fix? https://github.com/realm/realm-js/pull/855#issuecomment-282658385
Yes, I did but it didnt help.
From: Victor Grishchenko notifications@github.com
Sent: Friday, March 3, 2017 12:06 PM
To: realm/realm-js
Cc: Suresh Parameshwar; Mention
Subject: Re: [realm/realm-js] Unknown named module: './submit-analytics' when debugging with vs code (#873)
@sparameshwarhttps://github.com/sparameshwar did you use the VS Code fast fix? #855 (comment)https://github.com/realm/realm-js/pull/855#issuecomment-282658385
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/realm/realm-js/issues/873#issuecomment-284056912, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGNPJrXDkUoTdIAAjaS6K-FE8GgSklAfks5riHKtgaJpZM4MFLvW.
@sparameshwar Then, you may try using an older VS Code release while waiting for a new release that fixes the regression https://github.com/Microsoft/vscode-react-native/issues/406#issuecomment-282670868.
i just tried debugging today on VSCode 1.11.1 and it crashed with this error too. bummer. any eta on a fix ?
@gritzko there is missing https://github.com/realm/realm-js/commit/f6347cf59fd71f90723f38f63152418ab642f348 to fix getContext issue in the latest release. Can you confirm it will be release in the next release please? It's the only bug related with this issue now.
Anyone knows how to fix this?
I'm running react native with realm 1.3.1 and VSCode 1.12.2 and still get this error when trying to debug using VSCode and React Native Tools:
"Unknown named module: './submit-analytics'
Module AppRegistry is not a registered callable module (calling runApplication)"
Any help will be super appreciated.
Same error. Debugging is impossible atm.
I'm having this issue too, deleted the nodeRequire('./submit-analytics')('Run'); in /.vscode/.react/index.android.bundle
But it was there again after another debugging attempt.
Should we consider this a vscode bug?
I'm using the hotfix by @blagoev https://github.com/realm/realm-js/commit/3764d4bf55ee604b2fdd3f02eb6a3e25dd0b07fd
It works fine
I will be creating a PR for merging this then. Cheers everyone!
Most helpful comment
I found the error in realm/lib/index.js
as about line 21 "function getContext()"
The function returned "nodejs". but not "reactnative"