This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-08
Channels
- # announcements (1)
- # asami (3)
- # babashka (51)
- # beginners (86)
- # chlorine-clover (1)
- # cider (18)
- # clara (5)
- # clj-kondo (6)
- # cljsrn (6)
- # clojure (2)
- # clojure-europe (18)
- # clojure-uk (1)
- # clojurescript (57)
- # clojureverse-ops (2)
- # code-reviews (9)
- # cryogen (11)
- # depstar (5)
- # jackdaw (2)
- # malli (8)
- # nrepl (2)
- # off-topic (66)
- # practicalli (3)
- # reitit (6)
- # shadow-cljs (83)
- # sql (4)
- # vim (24)
- # xtdb (4)
Hello, I'm trying out cljs+krell for react native development. I could finally run a simple app after some troubleshooting, and I can successfully run the repl from the command line (using the clj
cli tool), but when I try to run the krell repl from cider I get this error:
Execution error (ExceptionInfo) at cljs.repl/evaluate-form (repl.cljc:577).
ReferenceError: Can't find variable: cljs
Does anyone have a clue about this error?Yes, that's right. I also tried with the "custom" jack in option and inserting
(do (require '[clojure.edn :as edn]
'[ :as io]
'[cider.piggieback]
'[krell.api :as krell]
'[krell.repl])
(def config (edn/read-string (slurp (io/file "build.edn"))))
(krell/build config)
(apply cider.piggieback/cljs-repl (krell.repl/repl-env) (mapcat identity config)))
when prompted for a form to start the repl@U0ETXRFEW I can provide more detailed information - stack trace, edn files or even just push the whole thing on github if that is useful to understand the issue. It's just the hello krell app anyway.
I’m not a Cider user myself, but I use the same infrastructure (cider-nrepl, piggieback) and I could get the hello krell thing to work the other day. Maybe something has happened with Krell… I saw your questions and solution in the #cljsrn channel… Can you try with this sha for the Krell dep? c487f7c3a8ce1b3d74757d5a0af2a776f7704d94
@U0ETXRFEW Still having the same issue 😞
This is my deps.edn
file:
{:deps {io.vouch/krell {:git/url ""
;; :sha "a6bf860df2385384b36dea68bcf2e3163a14bfa8"}
:sha "c487f7c3a8ce1b3d74757d5a0af2a776f7704d94"}
io.vouch/reagent-react-native {:git/url ""
:sha "0fe1c600c9b81180f76b94ef6004c2f85e7d4aa0"}
reagent/reagent {:mvn/version "1.0.0"
:exclusions [cljsjs/react cljsjs/react-dom]}}}
I see only two differences from mine.
1. I’m using this sha for reagent-react-native
0fe1c600c9b81180f76b94ef6004c2f85e7d4aa0`
2. I’m using reagent 0.10.0
tried changing reagent version but nothing changed 😕 this is the full exception stack trace: https://gist.github.com/laynor/c6b0a85d200560f359cf007f6d04fef3
I actually also tried to get your example running https://github.com/PEZ/awesome-krell-project but I'm running into other issues (NPE when starting the repl from the command line, same issue as my project from cider)
Also, when I run the app on the android emulator, it stays stuck in the "Waiting for krell to load files" screen
ok thanks! here it is https://github.com/laynor/krelltest
Hey thanks for giving it a go! My system details: Os: Arch linux Emacs: recent version compiled from sources (master). native comp enabled Cider version: "CIDER 1.1.0 (package: 20210422.802) (Plovdiv)" clojure --version: Clojure CLI version 1.10.3.822
Output of java --version
θ60° [ale:~/src/krelltest] master(+7364/-6020) ± java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Very hard to know what’s relevant. 😃 I use Java15 at the moment. Will try with Java 8. But first will try with latest clojure CLI.
It seems I'm getting the same error with Calva: the repl shows this
clj꞉user꞉> ; Use `alt+enter` to evaluate
; Creating cljs repl session...
; Connecting cljs repl: deps.edn + Krell...
; The Calva Connection Log might have more connection progress information.
; Execution error (ExceptionInfo) at cljs.repl/evaluate-form (repl.cljc:577).
ReferenceError: Can't find variable: cljs
(by the way, what keybinding did you use to send the current form to the repl when you recorded?)
I have no easy way to try with newer nodejs. I depend on node a bit too heavily to dare. But I seriously also doubt that is the problem here.
> (by the way, what keybinding did you use to send the current form to the repl when you recorded?)
Run the command Fire up the Getting Started REPL to get a short primer on evaluating stuff in Calva. 😃
I'll try with your node version to see if sometihng changes ^^ Calva looks slick but switching from emacs is very very painful for me ahah
@U0ETXRFEW It's working on emacs/cider with your node version!! 🥳 The other difference is that this node is installed in my home, while the former one was the system one - this might make a difference if some script tries to install something globally I guess. Strange thing - the calva repl hangs waiting the cljs repl for some reason (it stays stuck at the java repl). Don't know what's wrong - I tried switching clj/cljs from the command palette but I may just have done something wrong.
btw, I wanted to understand about the node thing - so I installed v16.1.0 with nvm and got the same issue as before. So I went back to v14.3.0, but now I got the bug on v14.3.0 too @.@
Post about this in the #nrepl channel. Maybe someone there has a clue given what we have tested and that stacktrace.
strangest stuff - I have a copy of the same project (after I pushed, i recloned the repo I shared with you to test it before giving you the url) and if I run npx react-native start
and npx react-native run-android
in the newer clone, but then jack in from the old project, I get a half working repl (I reach the cljs.user =>
prompt and can for example open an alert window on the app, but I get other errors in the repl (cljs.pprint.pprint related).
Do you have better luck with shadow-cljs, maybe? Could be worth a try, unless you have specific reasons to use Krell.
but I often had to clear the expo app data and restart things due to some weird errors (that now I can't really remember well)
having so many layers disturbs me a bit because the amount of things that I don't understand increases
before trying krell I tried setting up a shadow-cljs + reagent project but can't really remember what went wrong
@U0ETXRFEW just to let you know, I finally opened an issue on krell's github - I tried some old versions and finally I got one of them working (last commit Feb 25) - it appears the issue is triggered by some relatively recent changes in krell itself.
@qmstuart evaluating (run-tests)
should work. And as @emilaasa suggests, using Calva custom REPL commands for it can sweeten up the workflow. But first the evaluation must work of course… If you can create a minimal repro project that we can clone, I can give it a spin and see what I can figure out.
Hi guys I'm using VS Code and Calva and I have this task where I need to get a value from my win 10 environment using System/getenv, it works in first try but when I updated the value and then call getenv again it doesn't return the updated value. Is there anyway I could get the new value without having to restart my PC?
System variables are set in the shell when it starts; the process reads those. If you want the Clojure process to reflect an updated environment variable, you need to call System/setenv in the same process.
You can't set the environment of a child process when it is started. I think only Plan 9 supports that. But neither should a system restart be necessary. Restarting the REPL from where you have changed the environment variable is enough. If you are using Calva Jack-in you can use the jackInEnv setting and then just jack-in again, which will restart the REPL with the variables you have set in the setting.
@oliver.heck That is shorthand for ^{:export true}
which is metadata added to the symbol (or more generally expression) that follows it.
See https://clojure.org/reference/metadata#_metadata_reader_macros specifically (but that whole page in general)
The assumption in cljs is that you will be passing the output through the google closure compiler, with will mangle all the names
Marking for export let's google closure know you want to be able to refer to that name from some external code
Hi. I am currently going through Web development in clojure and learning Luminus. I want to migrate my H2 db to add a column. The problem: Since I had SQL Exception, I get the "Migration reserved by another instance" message. What would be your quickest way to edit the schema_migrations table in my database, like it says here? https://clojure.tgenedavis.com/2020-10-01/clojure-migratus-migration-reserved-by-another-instance/ Should I get the H2 Console app or is it an easier way?
Got the http://db.mv file opened in DbVisualizer, found the schema_migration table but there is no row that has id of -1 and Drop table is a pro feature.. EDIT: Managed to drop the migration table with a script.. seems like I fixed the issue. I would never do this in production or anything, seems like a pretty nasty bug?
Has anyone here used this library? https://github.com/alaisi/postgres.async