Fork me on GitHub
#conjure
<
2021-12-17
>
Proctor02:12:54

Not sure if this is a Conjure thing, or a CLJS/Figwheel thing, but getting this when I try to eval a file:

; (err) #object[SyntaxError SyntaxError: Unexpected identifier]
; (err) /Users/sproctor/.../update.cljs:1
; (err) (ns update
; (err)     ^^^^
; (err) 
; (err) SyntaxError: Unexpected identifier
; (err)     at new Script (vm.js:88:7)
; (err)     at createScript (vm.js:261:10)
; (err)     at runInThisContext (vm.js:309:10)
; (err)     at Object.nodeGlobalRequire (/Users/sproctor/.../target/fig/goog/bootstrap/nodejs.js:114:25)
; (err)     at cljs$core$load_file (/Users/sproctor/.../target/fig/cljs/core.js:325:13)
; (err)     at eval (eval at figwheel$client$utils$eval_helper (/Users/sproctor/.../target/fig/figwheel/client/utils.js:155:8), <anonymous>:1:313)
; (err)     at eval (eval at figwheel$client$utils$eval_helper (/Users/sproctor/.../target/fig/figwheel/client/utils.js:155:8), <anonymous>:9:3)
; (err)     at figwheel$client$utils$eval_helper (/Users/sproctor/.../target/fig/figwheel/client/utils.js:155:8)
when I eval a buffer, I get a result of nil, but not everything loaded in CLJS (with Figwheel)…. Clojure works as expected

Olical09:12:48

Not sure right now, but do other namespaces work? Is it just because your namespace is called update?

Proctor13:12:05

no namespaces, just elided the details as this is for a work project

Proctor13:12:27

it is always showing the error on the first character of the namespace

Proctor13:12:14

just got a chance to test on a work shadow-cljs project that is node backed, and the eval (file) works, so looks like it might be a lein-fighweel related issue, or the way I connect to that repl

Olical13:12:55

It may well be that with shadow you don't need to piggieback and figwheel you do :thinking_face: This might help if you're using figwheel.main but I don't think you are, I think lein-figwheel is the older version https://gist.github.com/pyrmont/73d10c74d14f26772fd276c38ee3490d And here's Conjure's docs on piggieback https://github.com/Olical/conjure/blob/2752d956f26d47cc14dfe74eda72898cd3e84440/doc/conjure-client-clojure-nrepl.txt#L56-L66

Olical13:12:36

Because you can connect to a figwheel nREPL but I think it's in a weird JVM mode at first, then you "piggieback" the nREPL into CLJS land... it's a little confusing. I much prefer shadow-cljs' method 😅

Proctor16:12:25

will have to try that… been doing things like (figwheel-sidecar.repl-api/start-figwheel!) and (figwheel-sidecar.repl-api/cljs-repl "development") which turns the REPL session into a CLJS version

Proctor16:12:37

but maybe I then need to piggieback on top of that…

Proctor16:12:58

I think our end-goal is the slow migration to just deps.edn and the straight CLJS node runtime REPL, since we are doing node for AWS Lambdas…