Fork me on GitHub
#shadow-cljs
<
2019-01-14
>
grounded_sage02:01:12

I'm getting this error on an existing project I am revisiting and not sure where to start on fixing it.

cp: cannot stat 'PREFIX/example-deps.edn': No such file or directory

grounded_sage03:01:50

I've changed machines and thus downloaded new version of shadow etc

grounded_sage03:01:17

Seems to be related to using the :deps config option

grounded_sage03:01:21

nvm this seems to be a clj on linux issue as I can't even run clj repl

Mark Addleman23:01:45

I would like to develop my server-side code in the same JVM as is delivering the HTML and javascript in order to avoid CORS issues. Ideally, I would start shadow-cljs and then connect to the nREPL server from Cursive and be off to the races. I couldn't find reference to this workflow in the shadow-cljs docs but I could have easily missed something.

lilactown23:01:09

@mark340 so you have a Clojure service?

Mark Addleman23:01:26

Yes. The browser and the server communicate using sente

lilactown00:01:10

so your Clojure service should serve up your index.html and JS file

Mark Addleman00:01:55

It will do that in production. During development, I'd like shadow-cljs to serve them up to get the benefits of live reloading.

Mark Addleman00:01:22

Unless there is a method for getting shadow's live-reloading through my Clojure service

lilactown00:01:12

live-reloading is handled through the JS code that is generated by shadow-cljs

lilactown00:01:41

shadow-cljs' HTTP server is only a helper for people who are developing against some external service

Mark Addleman00:01:34

Oh, interesting. Is there some example of manually loading the necessary JS code?

lilactown00:01:55

? what do you mean?

lilactown00:01:12

you put the generated JS script on the page

Mark Addleman00:01:17

I think I'm very confused 🙂 In my current workflow, I have some cljs source and an index.html file. shadow-cljs serves the index html and my compiled cljs. There must be some additional JS that shadow-cljs injects in order to manage live reloading. Is that correct?

lilactown00:01:17

your index.html should be including a JS file, correct?

lilactown00:01:08

e.g. js/main.js. that JS is generated by shadow-cljs. it is your CLJS app's code

lilactown00:01:38

shadow-cljs, when in development mode, adds to your compiled code the stuff required for hot-reloading

lilactown00:01:55

so you only ever need to load the one JS bundle, in this case js/main.js

Mark Addleman00:01:18

> shadow-cljs, when in development mode, adds to your compiled code the stuff required for hot-reloading

Mark Addleman00:01:25

This is the piece I was missing

Mark Addleman00:01:31

I had assumed it was a separate JS file

thosmos01:01:52

@mark340 there's also a way to run JVM server code within the JVM server that shadow-cljs starts. There's info in the manual about that. https://shadow-cljs.github.io/docs/UsersGuide.html#clj-run

👍 5