Fork me on GitHub
#cljsrn
<
2020-07-15
>
raspasov01:07:28

@bhauman is there a config option that I can set for:

optionsUrl: ""

raspasov01:07:42

I need this to be “192.168.1.62” (my local ip) instead of “localhost”

raspasov01:07:54

The optionsUrl is in the generated index.js ; I use the local IP so I can test/refresh on a real device rather than the simulator

Oliver George11:07:15

Anyone having a good time with Krell running on a real android device? I'm seeing odd issues which I think might be race condition related.

Oliver George11:07:27

e.g. namespaces loading out of order

Oliver George11:07:50

It's proving hard to pin down

Oliver George11:07:12

Tends to express itself in errors like these: • "TypeError: goog.debug.freeze is not a function" (common on one big project) • "goog.require could not find: awesome_project.core" • "ReferenceError: re_frame is not defined"

Oliver George12:07:28

Tentitive theory that perhaps waitForCore needs to wait on more files to avoid a race condition

function waitForCore(cb) {
    // we only care if goog/base.js is actually in the cache, that's enough
    // to bootstrap regardless whether some things must be refetched
    if(KRELL_CACHE.ready
       && KRELL_CACHE.has(toPath("goog/base.js"))
       && KRELL_CACHE.has(toPath("goog/deps.js"))         // <-- HERE
       && KRELL_CACHE.has(toPath("cljs_deps.js"))         // <-- HERE
       && KRELL_CACHE.has(toPath("krell_repl_deps.js"))) {// <-- HERE
        bootstrap();
        cb();
    } else if(typeof cljs !== 'undefined') {
        console.log("typeof cljs !== 'undefined'")
        cb();
    } else {
        setTimeout(function() { waitForCore(cb); }, 250);
    }
}

Oliver George12:07:58

@dnolen I think you had a productive android device setup - is that right? we're having trouble.

dnolen12:07:37

yes that sounds like load order issues - this would only occur during dev

Oliver George12:07:46

That's where we're seeing it

dnolen12:07:00

but I never saw that after the fixes for android

dnolen12:07:24

if you look closely at the code for Android in the REPL JS you'll see that there's a few things in place to ensure order

dnolen12:07:48

it's possible I missed something but it hasn't come up in the emulator or on the device (personally) in some time

dnolen12:07:45

one thing you could try is that you could bump the tcp-socket dep, I think there were several issues w/ how it worked and some have been addressed

dnolen12:07:09

I'm back on work that directly needs Krell so I should be more active again on in it the coming weeks

Oliver George12:07:43

Okay, thanks. I'll give that a try and see what else I can pin down.

dnolen12:07:10

note the issue really is the tcp-socket library

dnolen12:07:28

if you don't manually enforce the order then you will eval something out of order

dnolen12:07:32

and get the errors above

dnolen12:07:56

(the Java part of it, I never had issues w/ the iOS side)

Oliver George12:07:11

Certainly would describe what I'm seeing.

Oliver George12:07:37

Bumping to the latest react-native-tcp-socket doesn't seem to have helped.

Oliver George12:07:23

I have a feeling the clue is this error which appears in adb logcat > 07-15 19:29:32.163 21032 21195 I ReactNativeJS: 'Bootstrap from cache failed:', { [TypeError: undefined is not an object (evaluating 'KRELL_CACHE.get(toPath("goog/deps.js")).source')]

Oliver George12:07:47

Anyway, I'm out of ideas for today. Thanks for the suggestions.

dnolen13:07:31

@olivergeorge ah yeah I was going to say that's the other possibility your cache was corrupted - i.e. the issue is not related to react-native-tcp-socket at all

dnolen13:07:32

again I didn't observe this with the tutorials nor in our app - but I'll double check - if you can repro in a simpler situation that would be helpful