@bhauman is there a config option that I can set for:
optionsUrl: "<http://192.168.1.62:9500/cljs-out/ios/cljsc_opts.json>"
I need this to be “192.168.1.62” (my local ip) instead of “localhost”
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
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.
e.g. namespaces loading out of order
It's proving hard to pin down
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"
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);
}
}
@dnolen I think you had a productive android device setup - is that right? we're having trouble.
yes that sounds like load order issues - this would only occur during dev
That's where we're seeing it
but I never saw that after the fixes for android
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
it's possible I missed something but it hasn't come up in the emulator or on the device (personally) in some time
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
I'm back on work that directly needs Krell so I should be more active again on in it the coming weeks
Okay, thanks. I'll give that a try and see what else I can pin down.
note the issue really is the tcp-socket library
if you don't manually enforce the order then you will eval something out of order
and get the errors above
(the Java part of it, I never had issues w/ the iOS side)
Certainly would describe what I'm seeing.
Bumping to the latest react-native-tcp-socket doesn't seem to have helped.
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')]
Anyway, I'm out of ideas for today. Thanks for the suggestions.
@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
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