Fork me on GitHub
#figwheel-main
<
2020-04-30
>
dominicm18:04:40

Using figwheel, I'm getting an issue with uix: > java.io.FileNotFoundException: /src/target/dev/public/frontend.out/cljs/loader.js (No such file or directory) Initial build is fine, but reloading is not. I suspect it's an issue due to uix using the cljs.loader namespace. I currently have uix in my built-inputs due to various reasons. Here's the line where uix uses cljs.loader: https://github.com/roman01la/uix/blob/master/core/src/uix/core/lazy_loader.cljc#L6

kvlt18:04:33

Hi all, silly question I seem to be stuck on... When I run clojure -m figwheel.main I get the figwheel-main page opened and connected. However, when I specify a buildfile dev.cljs.edn with the contents:

{:main myapp.moo}
with the corresponding file src/myapp/moo.cljs:
(ns myapp.moo)

(js/console.log "Hello there world!")
It seems to be unable to connect using the command: clojure -m figwheel.main --build dev --repl Am I missing something?

dominicm18:04:20

@petr have you opened the browser?

dominicm18:04:38

In your browser console, are there any indications it may not have connected?

kvlt18:04:40

It's set to open automatically.

dominicm18:04:44

Figwheel likes to log

kvlt18:04:51

The browser does not log anything

kvlt18:04:51

Actually, that appeared to be a dependency issue: It now logs

moo.cljs:3 Hello there world!
console.js:203  [.WebSocket] Opening the WebSocket on 
websocket.js:283 WebSocket connection to '' failed: Error during WebSocket handshake: Unexpected response code: 500
console.js:203  [.WebSocket] An error occurred: undefined
console.js:203  [.WebSocket] The WebSocket on  closed.
console.js:203  [.WebSocket] The WebSocket disconnected unexpectedly: undefined
console.js:203  [.WebSocket] Seconds until next reconnect attempt: 1
console.js:203  [.WebSocket] Opening the WebSocket on 
websocket.js:283 WebSocket connection to '' failed: Error during WebSocket handshake: Unexpected response code: 500
console.js:203  [.WebSocket] An error occurred: undefined

dominicm18:04:26

A 500 while creating the websocket... hmm... My best guess is a jetty version conflict.

dominicm18:04:04

I would have hoped you'd get more details though, maybe in the repl or something. But as you didn't mention it, I'm guessing you didn't.

dominicm19:04:46

@petr Do you have other deps in your proj? can you share?

Jordan Yee19:04:38

@petr See this: https://figwheel.org/docs/main_script.html Copied from about halfway down the page: Figwheel and compile options when using `--main` Since the `-m` and `-b` options cannot be used at the same time you may be left wondering how to supply the options that you would normally supply with the `--build` option to the `--main` option. You can do this by providing your `[build-id].cljs.edn` file to the `-co` option. Figwheel will pick up both the metadata config along with the CLJS compiler config. For example the following will allow you to use the config in your `dev.cljs.edn` file:

$ clj -m figwheel.main -co dev.cljs.edn -m example.hello

Jordan Yee20:04:07

On second glance, I don't think that applies to you, since you're running the clojurecommand, not clj. Disregard.

kvlt20:04:37

Sorry for the run around. Ive decided to stick with sidecar, the move to figwheel-main was proving to be aquite a pain

kvlt20:04:43

Thank you all for the help

dominicm20:04:22

@petr if you're migrating, I'm certain it's a dependency conflict

kvlt21:04:00

I do not have jetty specified as a dependency

dominicm22:04:45

@petr worth checking your dependency tree :)