realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Debugging with IntelliJ/WebStorm

Open jasonfma opened this issue 9 years ago • 9 comments

This is super early lead. WebStorm is starting to support React Native debugging (https://blog.jetbrains.com/webstorm/2016/10/webstorm-2016-3-eap-163-6512/) and I tried it out and ran into what looks to be the same constructor issue as we saw in VS Code debugging.

jasonfma avatar Oct 20 '16 15:10 jasonfma

IntelliJ is now public with react native debugging support. https://www.jetbrains.com/idea/whatsnew/#v2016-3-react-native

jasonfma avatar Nov 22 '16 20:11 jasonfma

Linking the VS Debugging issue https://github.com/realm/realm-js/issues/583

jasonfma avatar Nov 22 '16 20:11 jasonfma

Latest error against 1.0.2

screen shot 2017-02-07 at 11 17 23 pm

jasonfma avatar Feb 08 '17 07:02 jasonfma

Is there any workaround for this issue? It kind of sucks that I cannot debug my application because of realm.

michalpetrov avatar Feb 28 '17 09:02 michalpetrov

I've been using the default chrome/web browser debugger.

jasonfma avatar Feb 28 '17 21:02 jasonfma

+1

jellebreuer avatar Jun 21 '17 12:06 jellebreuer

I wasted several hours on this :( - browser debugger is you only choice. realm/lib/index.js - Line 26 (getContext()) appears to have some custom logic for detecting if it's using Chrome or not. It appears IntelliJ isn't sending a userAgent to pick up on either.

rovangju avatar Jun 26 '17 06:06 rovangju

2017-06-26 01_25_12-rn0 - h__code_rn0 - _node_modules_realm_lib_index js - intellij idea 2017 1 Here's a debug dump - breakpoint at https://github.com/realm/realm-js/blob/v1.8.1/lib/index.js#L29

I'm not sure why process + '' === '[object process]' is in there, but if I remove that and toss this inside the function, my IntelliJ Debugger for RN works just fine:

        if ('env' in process && 'NODE_ENV' in process.env) {
            return 'chromedebugger';
        }

rovangju avatar Jun 26 '17 06:06 rovangju

See also #1530.

kneth avatar Dec 05 '17 12:12 kneth