Stand down red alert. Clearly my env variables didn't make it to the node invocation. This worked...
This put me on to it: https://github.com/facebook/react-native/issues/22021
Yup… That has tripped me before.
@laynor those look like tools deps problems?
I don't see how Krell is involved in that trace
I would delete .cpcache
and ~/.gitlibs
and try again
if it persists I think probably need to ask in #tools-deps on how to debug
I already deleted everything - actually I had a friend install the tools from scratch (not a clojure user), and he had the same result. I myself tried to reinstall every tool (java, node, clojure etc) starting from a newly created user on my machine. I'm installing node with nvm, android studio, sdk and clojure on the home directory, so the only shared dependency is (to my knowledge) java.
reverting to an older krell version fixed the issue, as outlined in the bug report
I'm not saying the problem is not in the tools - just that the previous krell version did not trigger the issue
@laynor we're using shas close to master on two projects and I haven't seen this one
I don't think anything else on your system matters - the failure is from tools-deps
the blame can't be on Node, or Java, or Clojure or anything else
it's true, it could be in Krell, I'll try the tutorial now and see what happens
Linux?
Yes
In particular, an up to date Arch linux machine
Arch is quite quick with releasing updates so it might be triggered by some "new" package version
I honestly have no clue aside from observing the behavior
I can bisect to reach the problematic commit - what directories would you suggest to delete at each try? @dnolen would .cpcache target ~/.gitlibs be enough?
yes
tools-deps still has caching / sha fetch bugs from what I can tell
I hit some on M1 and had to switch to dev version
but even on non-M1 Apple hardware I occasionally hit null-pointer exceptions when constructing the classpath
I see - I haven't seen NPEs, but I can switch to the dev version if that can help in some way - just don't really know how
I'm very much a beginner with clojure, just played long ago
I'll start bisecting and let you know
Error building classpath. Cannot invoke "java.io.File.isAbsolute()" because "f" is null
java.lang.NullPointerException: Cannot invoke "java.io.File.isAbsolute()" because "f" is null
@laynor that is from your bug report above
that is an NPE
uh, you're right
I was thinking about the topmost exception and forgot about the inner one, sorry
re: Cider this one is more annoying
but I think I see the problem
oh, but wait - that one I solved
that's not the issue I'm talking about
this is it
I was just checking the stack trace to see if I had actually forgotten the NPE - but I don't see any in the stack trace in my bug report on GH.
the NPE I reported here on the channel was due to some problem with the git SHAs that I copied from the tutorial or from the readme itself.
the tutorial references
io.vouch/reagent-react-native {:git/url "<https://github.com/vouch-opensource/reagent-react-native.git>"
:sha "0d25830bd0bf02baf272b9c60d3edefc6766ef24"}
but I do not see that hash here https://github.com/vouch-opensource/reagent-react-native/commits/master
oh
so I went on and used the latest hashes for both krell and reagent-react-native
and finally got the error that I reported on the GH issue
erg sorry yeah fixed it up
thanks
NP
😉
I must say, it was a very confusing error for a non-existent hash
the Cider thing is a bit less clear to me
what happens is that Krell does not even try to connect until cljs.core
is loaded to avoid this kind of issue
So Krell startup is blocked, and thus Cider startup is blocked until the RN environment connects (which is after cljs.core is available)
so at least at first glance I cannot understand it since this is the exact same bug I had to fix for cljs.main
style interaction
https://github.com/vouch-opensource/krell/blob/master/resources/krell_repl.js#L167-L172
@laynor so in the Metro terminal do you see "Connected to Krell REPL Server"
I was just setting up a script to automate the cleaning/building etc to let you know, as if I remember correclty, I do see it
@dnolen this is from the output of npx react-native start
LOG Running "Dondai" with {"rootTag":11}
LOG Connected to Krell REPL Server
ERROR Could not evaluate form: (cljs.core._STAR_print_namespace_maps_STAR_ = true) [ReferenceError: Can't find variable: cljs]
I was watching the commit introducing these lines yesterday, as it was the most suspect from an outsider point of view, but going back did not solve the issue as you might suspect. I might not have cleaned everything properly at the time though.
@laynor what happens when you refresh Metro?
the repl stays stuck, and the "Could not evaluate form: ..." line is not printed
if i try reconnecting, the same error is raised
this could very well be a Cider issue - sounds pretty weird
or Cider/Piggieback issue
@laynor I don't use Cider and not super interested in spending time figuring out Cider/Piggie specific prbolems
too much time wasted w/ that stuff for me to ever look at it again
but
debugging Krell is trivial
you can edit krell_repl.js
and drop some console.logs
don't ClojureScript compile/recompile, just start the app and try to connect the REPL
and you should see your logging
the situation you're describing seems impossible but maybe a bit more logging when the REPL connects will clarify something
I'll try to investigate and let you know - I'm now bisecting
a bit of a long process because of issues with react-native-tcp-socket
@laynor one thing is why you need Cider though - are you using Calva?
if you're not using Calva and you're doing ClojureScript there's is no benefit
and really Calva should support standard REPLs
tooling that starts w/ nREPL is fundamentally broken in IMO
I tried both - and same issue in both of them
I'm using emacs
but lsp is kinda broken (missing docs, cannot jump on some functions) so I'm using cider
@laynor hrm I'm very skeptical about cljs.main
issues
did you try outside of the editor a la tutorial?
you mean the repl? it works flawlessly
ah k Emacs - sorry right other reason to Cider
yeah I would put a little a bit of debugging to see
I just don't see how Cider could connect and then cljs
fail to evail
I have 1/10th the clues you have 😆 Are you using jetbrains' stuff?
edit
edit?
target/krell_repl.js
like I said
if you don't compile then this file is not touched
this is how I debug Krell
those lines I linked to in the source above would give you all the info
i.e. how can cljs.core
not be available
you can add more console.log
s right there
@laynor re: what I use - anything that let's me use cljs.main
approach - I use IntelliJ, but I also use the shell
when I was in Emacs I switched to clj-inf to avoid the issues
I see - I'm not very well versed- very much a beginner - so I don't really know about the different approaches out there. I'll try to look into it.
anyway, fwiw, the issue appears somewhere from d0e1153 to d0e1153, with 6154649 still giving me a mostly working cljs prompt but riddled with errors (http://goog.xyz already declared, I've seen some related fixes in the git log)
@laynor one dummy check
your target/krell_repl.js
must look like exactly the one in master
if it doesn't - not going to work
basically I'm saying the behavior you are seeing simply doesn't not seem possible
so check some assumptions
shall I use krell's master version and double check target/krell_repl.js?
I mean compare your not working thing w/ master
if your krell_repl.js
does not look like master then your bug report makes perfect sense
because that was fixed
and if it's not fixed version for you locally - then it cannot work
this is the diff:
[ale:~/src/krelltest] master(+1792/-15603)* ± diff repl_tmp.js target/krell_repl.js
15,16c15,16
< var SERVER_IP = "$KRELL_SERVER_IP";
< var SERVER_PORT = krellPortMap ? krellPortMap[DeviceInfo.getDeviceId()] || $KRELL_SERVER_PORT : $KRELL_SERVER_PORT;
---
> var SERVER_IP = "192.168.11.14";
> var SERVER_PORT = krellPortMap ? krellPortMap[DeviceInfo.getDeviceId()] || 5001 : 5001;
18c18
< const KRELL_VERBOSE = $KRELL_VERBOSE;
---
> const KRELL_VERBOSE = false;
[ale:~/src/krelltest] master(+1792/-15603)* 1 ± npx react-native start
issue as detailed on github - LOG Running "Dondai" with {"rootTag":11} LOG Krell sez howdy, Device ID: goldfish_x86 LOG Connected to Krell REPL Server ERROR Could not evaluate form: (cljs.core.STARprint_namespace_maps_STAR_ = true) [ReferenceError: Can't find variable: cljs]
can you enumerate the Android platform details you're trying this with
Installed packages:=====================] 100% Computing updates...
Path | Version | Description | Location
------- | ------- | ------- | -------
build-tools;29.0.2 | 29.0.2 | Android SDK Build-Tools 29.0.2 | build-tools/29.0.2/
build-tools;30.0.3 | 30.0.3 | Android SDK Build-Tools 30.0.3 | build-tools/30.0.3/
emulator | 30.6.5 | Android Emulator | emulator/
ndk;22.1.7171670 | 22.1.7171670 | NDK (Side by side) 22.1.7171670 | ndk/22.1.7171670/
patcher;v4 | 1 | SDK Patch Applier v4 | patcher/v4/
platform-tools | 31.0.2 | Android SDK Platform-Tools | platform-tools/
platforms;android-29 | 5 | Android SDK Platform 29 | platforms/android-29/
platforms;android-30 | 3 | Android SDK Platform 30 | platforms/android-30/
sources;android-30 | 1 | Sources for Android 30 | sources/android-30/
system-images;android-30;google_apis;x86 | 9 | Google APIs Intel x86 Atom System Image | system-images/android-30/google_apis/x86/
avd is on api 30
@laynor ok looks ok, which actual emulator? Pixel 3/4?
pixel 3a
you're not trying to use Hermes or doing anything like that right?
the default one android studio installs - I removed my old android studio install
never even heard about it
good
finally you get no ERROR
s about file failing to load?
TBH, before krell I was playing with shadow-cljs/expo but was encountering repl disconnects and other weird errors so I wanted to switch to krell to make the stack a bit less deep
that would be only other reason cljs.core
didn't appear
because something failed to load before it failing everyone after it
where would I see these errors?
in Metro
as ERROR ...
no other errors
and this is with the tutorial?
yup
I can try on Android now that we've narrow it down
you can even try my project, I posted the url on github - It'll most likely just work for you as it did for @pez
I mean on the github issue
it's just the krell hello world, nothing fancy
it's probably referencing some older version because at that time I tried to make the version of every package coincide with the ones @pez was using.
Yeah. Works like a charm on my Mac. Very strange.
@laynor this could be Android / Linux problem I'm trying to think about why ...
@laynor while I'm poking at this try Pixel4
@dnolen api level 30 ok? (android R)
yes
I mean Android version is mostly important for compatibility with react-native-tcp-socket - for the REPL part
but Krell now longer requires a REPL to function - so support for various Android devices is much wider now
but 30 should be OK for REPL that's what I'm using
alright, it's installing
fwiw, on OS X I'm testing Pixel 3 API 30 right now
no luck for me with pixel 4 - I'm kinda confident it'll work for you though
Krell was able to build the app - now verifying REPL connect
yeah all works
appears to be linux-specific, doesn't it
@laynor do you have Android device?
real device? yup
that would eliminate Linux environmnet oddities
npx react-native run-android
but w/ your device connected
lemme grab a cable, last test before going to bed, it's almost 2am here ^^;
@dnolen same issue with the physical device
btw, when I add logs and try to reconnect with cider, my krell_repl.js is overwritten
the app appears to be recompiling or something
this may sound ridiculous but still - I removed write permissions from the krell_repl.js file, tried to reconnect, got this error on the repl
nil#'user/configExecution error (FileNotFoundException) at java.io.FileOutputStream/open0 (FileOutputStream.java:-2).
target/krell_repl.js (Permission denied)
no errors in the metro terminal, and a working cljs replthere must be something wrong re. the automatic rebuild on repl connection
hrm, let's pick it up tomorrow
if you're not manually recompiling krell_repl.js should not be overwritten
so Cider/Piggie could very well be doing something very yucky
which is messing everything up
would not be first time
oh but this still plain REPL, nvm?
oh Cider ..
argh
let's keep Cider out of this please until we can isolate 🙂
unless you said above that plain REPL always works
the plain repl (as in clj -M ... -r
) works flawlessly, as I said before
oh ok
OK
the issue arises just with calva/cider
so then this might be it
Cider/Piggie may be doing something horrible
but only on the newer krell versions for some reasons
well because newer Krell is the right way
everything before was in fact broken
the new Krell has no issues
you never even need to restart the damn thing once you start the REPL once
it never hangs
it always flawless reconnects
it survivs RN refresh
app re-install
all possible scenarios and the REPL never needs to be restarted
so the fact that Cider worked before isn't important
Cider was broken and Krell were broken together
now Krell works - but Cider is doing something strange
all the niceties after d0e115309580ca0bdc782e4ca396df66a357d212 then?
ahah
yes once I changed Krell to always a produce a working RN app and to reuse Metro / fetch
I see - so we have a test case for the cider/piggie guys?
all the crazy bugs went away - iOS worked, Android works - and a dev can work even if they don't use a REPL
fewer deps, etc. etc.
I'd really like the two to go well together, cider is pretty handy and well integrated in emacs
@laynor it's possible - tomorrow we can try it verbose mode and you can probably see that Cider forces a recompile somehow
probably there's a way to stop it
yes
let's take a look tomorrow then, thanks for the help today :)
np