This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-24
Channels
- # announcements (2)
- # beginners (130)
- # calva (72)
- # cider (4)
- # cljdoc (15)
- # cljs-dev (3)
- # cljsrn (2)
- # clojars (4)
- # clojure (55)
- # clojure-nl (1)
- # clojure-uk (19)
- # clojurescript (46)
- # cursive (95)
- # datomic (6)
- # figwheel (40)
- # fulcro (12)
- # hyperfiddle (3)
- # off-topic (11)
- # onyx (3)
- # parinfer (6)
- # pathom (15)
- # protorepl (38)
- # re-frame (67)
- # reitit (18)
- # shadow-cljs (45)
- # tools-deps (2)
@jsa-aerial its probably because of the path that you are using for your main.js script
@bhauman I tried that but the results are the same. Poking around some more, I see from console log that the server (in Figwheel) expects everything (entire directory structure) to be under a Fig/public
directory instead of just the usual public
directory. So, nothing in the iindex.html file is found or loaded (including the "main.js" script. I even tried giving the absolute path starting with /public
but server still tries loading from Fig/public
(?!?).
OK, I even tried putting absolute and relative resources
in front. With /resources/public/path/to/main.js
the path is actually that, but the file is not found (maybe because it is really looking for /resources/resources...
??). If it is relative then it ends up being Fig/resources/...
. It doesn't look like it is possible to do this with the way Figwheel currently resolves paths.
@jsa-aerial yes something in your setup is off
OK - I don't have any other 'path' stuff configured - maybe there is an option I'm missing?
do you have the tree
program installed so that I can get a quick look at your directory structure?
One thing I do know. This project actually is all about setting up a client and server and when I start the projects server (on another port) it can serve the Fig/index.html
and correctly serve all the other resources.
So, it is definitely something about how figwheel is configured or setup.
Frankly, one 'solution' is to just browse to the projects server address and things simply work. But that's a bit annoying
Exactly - except figwheel does not get the resources correct. The project server does
@jsa-aerial does figwheel work when you are using the project server?
So, to be explicit this
(which opens automatically) gets the resources wrong, but this
gets the resources correct.
Yes
That's because it correctly serves up the 'main.js' script
OK - that sounds like a plausible solution - didn't know that
Maybe there is something else wrong - I have :open-urls
as the key (note ending 's'). Is that wrong? I got this from a template
I'm pretty sure I'm using figwheel-main. Well, I start by getting a repl (just lein repl) and then issue (use 'figwheel-sidecar.repl-api)
and then (start-figwheel!)
OK. I also have this for dev profile:
OK, yes, I am using lein-figwheel: [lein-figwheel "0.5.16"]
Which only goes to show how little I understand about how this is all plumbed...
Pretty much just following a 'cookbook recipe'
Let me try that
Yes, just plain works
And figwheel is still opening up port localhost:3449 - and if you browse there still serves up wrong paths. Shrug.
Since I always have the project server start (and in testing always use 3003) I can just use :open-urls
with that address and things will just work. Still, seems odd that the server at 3449 doesn't get this right. One thing the project server also does is set the resources route to "/": (route/resources "/")
. Maybe figwheel doesn't do that?