Fork me on GitHub
#duct
<
2019-01-21
>
madstap16:01:43

I'm struggling to get cljs working with the newest duct

madstap16:01:27

I run cider-jack-in-clj&cljs and run (go) in dev.clj, which compiles the cljs once, but doesn't watch src to recompile.

madstap16:01:47

Then I try to run this in the clj repl that is supposed to become a cljs repl.

user> (require '[duct.repl.figwheel :refer [cljs-repl]])
nil
user> (cljs-repl)
Execution error (IllegalStateException) at cemerick.piggieback/cljs-repl (piggieback.clj:234).
Can't change/establish root binding of: *cljs-repl-env* with set

madstap17:01:54

When I run cider-jack-in-clj&cljs it asks which kind of repl, with the options figwheel, figwheel-main and others. The above error appears when I choose figwheel-main. If I choose figwheel it errors on startup complaining about invalid cljsbuild config

user> Execution error (ExceptionInfo) at figwheel-sidecar.config/raise-one-error (config.clj:478).
------ Figwheel Configuration Error ------

Missing required key :cljsbuild at path []

  {:cljsbuild ...
   ^---- The required key :cljsbuild is missing
   }

madstap17:01:31

So, should I choose figwheel, figwheel-main or something else at jack-in time? Do I need to set any extra variables in .dir-locals.el to make this work?

weavejester23:01:59

@madstap It looks like you're using cemerick.piggieback rather than cider.piggieback. You might need to update your project.clj file and replace the piggieback dependencies with:

:dependencies [[cider/piggieback "0.3.10"]]
          :repl-options {:init-ns user
                         :nrepl-middleware [cider.piggieback/wrap-cljs-repl]}

madstap23:01:53

I am using the lein new duct from yesterday, so that's what my project.clj looks like

madstap23:01:17

I'm also on cider 0.20.0

weavejester23:01:32

Let me quickly check something.

weavejester23:01:28

Ah, whoops. It looks like the server.figwheel package wasn't updated to user cider.piggieback. Which is weird, because it worked fine for me in testing... perhaps some sort of dependency conflict that resolved in my favour but not in yours.

weavejester23:01:34

@madstap Unfortunately I don't think I can fix this until Thursday, but could you add an issue to https://github.com/duct-framework/server.figwheel so I don't forget?

madstap23:01:34

Yeah, I saw that there were some issues with cider/nrepl/lein]

weavejester23:01:51

Or you can open a PR to update the dependencies if you want.

madstap23:01:06

What would a fix involve, just updating the deps?

madstap23:01:19

I can make a PR, no problem

weavejester23:01:21

Deps and requires

weavejester23:01:10

I'm not sure whether that's your only problem, but it seems like a good place to start. I've run into compatibility problems with piggieback as well since the Lein 2.8.3 update.

madstap23:01:30

Yeah, I ran into some issues as well on another project which were fixed by upgrading cider and lein to the latest (so I didn't look any more into it)

madstap23:01:38

Just to confirm though, when I run cider-jack-in-clj&cljs I should choose figwheel-main as the cljs repl type?

weavejester23:01:21

I need to investigate, but I believe there's an option for setting the commands you need to start the cljs repl.

weavejester23:01:27

One sec while I check.

weavejester23:01:18

Hm, Cider docs have no information on what the option does.

madstap23:01:17

In another project I had some incantation in .dir-locals, some string with (do (require ',,,) (,,)

weavejester23:01:10

Ah, okay, they've changed how the whole cljs setup works. Not very backward-compatible of them, really.

weavejester23:01:50

And I'm not seeing a way to support the old functionality...

weavejester23:01:29

I'll ask about this on the Cider channel.

👍 1