duct

2019-01-21T16:55:43.015Z

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

2019-01-21T16:58:27.017200Z

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.

2019-01-21T16:59:47.018Z

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

2019-01-21T17:03:54.020200Z

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
   }

2019-01-21T17:06:31.021800Z

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?

2019-01-21T23:30:59.023300Z

@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]}

2019-01-21T23:33:53.024800Z

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

2019-01-21T23:34:17.025300Z

I'm also on cider 0.20.0

2019-01-21T23:34:32.025600Z

Let me quickly check something.

2019-01-21T23:36:28.027Z

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.

2019-01-21T23:37:34.028Z

@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?

2019-01-21T23:37:34.028100Z

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

2019-01-21T23:37:51.029Z

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

2019-01-21T23:38:06.029300Z

What would a fix involve, just updating the deps?

2019-01-21T23:38:19.029700Z

I can make a PR, no problem

2019-01-21T23:38:21.029800Z

Deps and requires

2019-01-21T23:40:10.032Z

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.

2019-01-21T23:42:30.034200Z

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)

2019-01-21T23:44:38.035300Z

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

2019-01-21T23:45:21.035900Z

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

2019-01-21T23:45:27.036200Z

One sec while I check.

2019-01-21T23:47:18.037Z

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

2019-01-21T23:48:17.037900Z

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

2019-01-21T23:53:10.038700Z

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

2019-01-21T23:55:50.039300Z

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

2019-01-21T23:56:29.039700Z

I'll ask about this on the Cider channel.

👍 1