question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot debug app with Expo and Realm

See original GitHub issue

Goals

I want to debug Expo app with Realm

Expected Results

Debugger should work

Actual Results

debugger-ui:1 Failed to load http://192.168.1.253:8083/create_session: The 'Access-Control-Allow-Origin' header has a value 'http://localhost:8081' that is not equal to the supplied origin. Origin 'http://localhost:19001' is therefore not allowed access.
AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:12199 DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://192.168.1.253:8083/create_session'.
    at makeRequest (http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:97187:18)
    at sendRequest (http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:97225:20)
    at Object.createSession (http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:97024:17)
    at http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:96699:41
    at loadModuleImplementation (http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:121:5)
    at guardedLoadModule (http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:85:12)
    at _require (http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:63:60)
    at http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:96463:28
    at loadModuleImplementation (http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:121:5)
    at guardedLoadModule (http://packager.h5-87c.tonkonozhenko.examplewithexpo.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:85:12)
reactConsoleErrorHandler @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:12199
(anonymous) @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:96706
loadModuleImplementation @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:121
guardedLoadModule @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:85
_require @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:63
(anonymous) @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:96463
loadModuleImplementation @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:121
guardedLoadModule @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:85
_require @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:63
(anonymous) @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:96311
loadModuleImplementation @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:121
guardedLoadModule @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:85
_require @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:63
(anonymous) @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:1289
loadModuleImplementation @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:121
guardedLoadModule @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:78
_require @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:63
(anonymous) @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:98788
executeApplicationScript @ debuggerWorker.js:40
(anonymous) @ debuggerWorker.js:65
AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:12191 Realm failed to connect to the embedded debug server inside the app. If attempting to use Chrome debugging from a device, ensure the device is reachable on the same network as this machine.
handleException @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:12191
handleError @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:15494
reportFatalError @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:697
guardedLoadModule @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:80
_require @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:63
(anonymous) @ AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:98788
executeApplicationScript @ debuggerWorker.js:40
(anonymous) @ debuggerWorker.js:65
AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:20102 Running application main ({
    initialProps =     {
        exp =         {
            appOwnership = standalone;
            initialUri = "xxx://xxx.tonkonozhenko.examplewithexpo.exp.direct:80";
            manifest =             {
                android =                 {
                    package = "com.tonkonozhenko.ex";
                };
                bundleUrl = "http://packager.xxx.tonkonozhenko.examplewithexpo.exp.direct:80/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles";
                debuggerHost = "packager.yyy.tonkonozhenko.examplewithexpo.exp.direct:80";
                description = "An empty new project";
                detach =                 {
                    androidExpoViewUrl = "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.0.0-exp.0-sdk22.0.0-xxx.tar.gz";
                    iosExpoViewUrl = "https://s3.amazonaws.com/exp-exponent-view-code/ios-v2.0.4-sdk22.0.0-xxx.tar.gz";
                    scheme = xxx;
                };
                developer =                 {
                    projectRoot = "/Users/alex/projects/react-native-stuff/ExampleWithExpo";
                    tool = xde;
                };
                env =                 {
                };
                icon = "./assets/icon.png";
                iconUrl = "http://packager.xxx.tonkonozhenko.examplewithexpo.exp.direct:80/assets/./assets/icon.png";
                id = "@tonkonozhenko/ExampleWithExpo";
                ios =                 {
                    bundleIdentifier = "com.tonkonozhenko.ex";
                    publishBundlePath = "ios/examplewithexpo/Supporting/shell-app.bundle";
                    publishManifestPath = "ios/examplewithexpo/Supporting/shell-app-manifest.json";
                    supportsTablet = 1;
                };
                isDetached = 1;
                isVerified = 1;
                logUrl = "http://xxx.tonkonozhenko.examplewithexpo.exp.direct:80/logs";
                mainModuleName = "node_modules/expo/AppEntry";
                name = ExampleWithExpo;
                orientation = portrait;
                packagerOpts =                 {
                    dev = 1;
                    hostType = tunnel;
                    lanType = ip;
                    minify = 0;
                    strict = 0;
                    urlRandomness = "xxx";
                    urlType = exp;
                };
                primaryColor = "#cccccc";
                privacy = public;
                sdkVersion = "22.0.0";
                slug = ExampleWithExpo;
                splash =                 {
                    backgroundColor = "#ffffff";
                    image = "./assets/splash.png";
                    imageUrl = "http://packager.xxx.tonkonozhenko.examplewithexpo.exp.direct:80/assets/./assets/splash.png";
                    resizeMode = contain;
                };
                version = "1.0.0";
                xde = 1;
            };
            shell = 1;
        };
    };
    rootTag = 1;
})
AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/alex/projects/react-native-stuff/ExampleWithExpo/node_modules/expo/tools/hashAssetFiles:sourcemap:12191 Module AppRegistry is not a registered callable module (calling runApplication)

Steps to Reproduce

  • Create empty project
exp init
exp detach
yarn add realm
cd ios
pod install
  • Import realm in App.json
import Realm from 'realm'
  • Run app in xcode

Version of Realm and Tooling

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Tonkonozhenkocommented, Nov 13, 2017

@bmunkholm if I was a react native or iOS developer, I would do it, but unfortunately I’m a backend developer and don’t know any concepts of react native development. I just wanted to attach some libs and start coding, but I didn’t manage to do it. So I’m trying to help the community in the way I can.

0reactions
bmunkholmcommented, Nov 13, 2017

@Tonkonozhenko It’s open source 😉 We are very happy to accept PR’s!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to debug a React Native app that uses RealmJS #955
I'm unable to debug inside of VS Code using the "Attach to Packager" configuration when I have a React Native project that includes...
Read more >
Debugging - Expo Documentation
Usually, debugging when running your app locally with Expo CLI is pretty easy, thanks to all the tools available in the Expo Go...
Read more >
Unable to connect with remote debugger - Stack Overflow
Press Cmd + M on emulator screen · Go to Dev settings > Debug server host & port for device · Set localhost:8081...
Read more >
Build an Offline-First React Native Mobile App with Expo and ...
This App is a prebuilt app as right now Managed Expo Workflows won't work with Realm React Native (yet, read more below). But...
Read more >
React Native Debugger + Expo = AWESOME - Medium
It runs the app in a tunnel that allows a direct connection to the app through the Expo app. To get RND to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found