Fork me on GitHub
#xtdb
<
2021-07-29
>
sheluchin15:07:47

I'm trying to integrate Crux into my Fulcro app and I keep getting errors - often inconsistent - but I have a feeling it has to do with how I'm using Crux and Mount. The latest error I'm seeing is:

iced repl :main --force-shadow-cljs --with-cljs -A:dev
OK: CLJS option is enabled.
OK: shadow-cljs project is detected
OK: For shadow-cljs project, start watching instead of starting REPL.
shadow-cljs - config: project/shadow-cljs.edn  cli version: 2.8.64  node: v12.18.0
shadow-cljs - starting via "clojure"
WARNING: Use of -A with clojure.main is deprecated, use -M instead
shadow-cljs - HTTP server available at 
shadow-cljs - server version: 2.11.23 running at 
shadow-cljs - nREPL server started on port 9000
shadow-cljs - watching build :main
[:main] Configuring build.
[:main] Compiling ...
GUARDRAILS IS ENABLED. RUNTIME PERFORMANCE WILL BE AFFECTED.
Mode: :runtime  Async? false  Throw? false
Guardrails was enabled because the CLJS Compiler config enabled it
[:main] Build completed. (309 files, 0 compiled, 0 warnings, 11.63s)


[2021-07-29 11:04:13.165 - WARNING] :shadow.cljs.devtools.server.nrepl-impl/init-ns-ex - {:init-ns sheluchin.user}
Note: The following stack trace applies to the reader or compiler, your code was not executed.
CompilerException Syntax error compiling at (crux/codec.clj:358:27). #:clojure.error{:phase :compile-syntax-check, :line 358, :column 27, :s
ource "crux/codec.clj"}
        clojure.lang.Compiler.analyze (Compiler.java:6808)
        clojure.lang.Compiler.analyze (Compiler.java:6745)
        clojure.lang.Compiler$InvokeExpr.parse (Compiler.java:3820)
        clojure.lang.Compiler.analyzeSeq (Compiler.java:7109)
        clojure.lang.Compiler.analyze (Compiler.java:6789)
        clojure.lang.Compiler.analyze (Compiler.java:6745)
        clojure.lang.Compiler$InvokeExpr.parse (Compiler.java:3888)
        clojure.lang.Compiler.analyzeSeq (Compiler.java:7109)
        clojure.lang.Compiler.analyze (Compiler.java:6789)
        clojure.lang.Compiler.access$300 (Compiler.java:38)
        clojure.lang.Compiler$LetExpr$Parser.parse (Compiler.java:6384)
        clojure.lang.Compiler.analyzeSeq (Compiler.java:7107)
Caused by:
RuntimeException No such var: mem/->nippy-buffer
        clojure.lang.Util.runtimeException (Util.java:221)
        clojure.lang.Compiler.resolveIn (Compiler.java:7388)
        clojure.lang.Compiler.resolve (Compiler.java:7358)
        clojure.lang.Compiler.analyzeSymbol (Compiler.java:7319)
        clojure.lang.Compiler.analyze (Compiler.java:6768)
        clojure.lang.Compiler.analyze (Compiler.java:6745)
Anyone know what the cause might be? I'm kinda new to Clojure -- I can read and write the code pretty well, but the build tools and runtime still give me trouble.

jarohen15:07:33

I've not tried to run Crux under shadow-cljs - there's lots in Crux (especially in crux.memory/`crux.codec`) that won't play nicely with ClojureScript. I'd probably try to exclude Crux from that in some way 🙂

jarohen15:07:14

Unfortunately it's been a long time since I've used shadow-cljs, I'd have to defer to someone more current about how to do that...

jarohen15:07:50

Maybe one for the #shadow-cljs channel?

jarohen15:07:11

Ah, you have already 🙂

sheluchin15:07:08

Thanks @U050V1N74, I'll keep searching.

🙏 3
richiardiandrea17:07:37

Hi there, what happens when :crux.tx/match fails? Is an exception thrown?

refset18:07:40

Hey, it will be logged by default, and you can check whether a transaction succeeded by calling tx-committed?

richiardiandrea19:07:34

Thanks Jeremy will try that out

🙏 3
richiardiandrea19:07:05

uhm this is not easy to test I guess - the scenario being throwing a 409 conflict when that happens...I'll probably need to with-redefs the function

refset20:07:18

hmm, I've not thought about mapping to 409s before, but I would be curious to hear about / see what you end up with

richiardiandrea14:07:26

well unless I am misunderstanding the semantics of it - it should be possible to match right before put to make sure the entity did not change..?

refset15:07:41

yep that's right, the mapping to 409 looks appropriate 🙂

refset15:07:55

@@malcolmsparks is intending to add 412s (with etags) to juxt/site in the not-too-distant future to do approximately the same thing also, see https://github.com/juxt/site/blob/f6f20f2e177fee4b3f55de4e65545aecc5b253b9/src/juxt/site/alpha/handler.clj#L282

❤️ 2
richiardiandrea16:07:49

@U899JBRPF for tx-committed? do I need to await-tx? It seems like I am receiving a bunch of "node out of sync" exceptions here

refset16:07:18

exactly yep, that's right 🙂

❤️ 2