This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-02
Channels
- # announcements (14)
- # beginners (133)
- # cider (27)
- # cljs-dev (7)
- # cljsjs (13)
- # clojure (105)
- # clojure-dev (58)
- # clojure-italy (1)
- # clojure-nl (17)
- # clojure-russia (33)
- # clojure-spec (5)
- # clojure-uk (154)
- # clojured (1)
- # clojurescript (35)
- # cloverage (4)
- # cursive (35)
- # datomic (58)
- # duct (8)
- # editors (9)
- # emacs (15)
- # events (1)
- # figwheel (47)
- # figwheel-main (132)
- # hyperfiddle (5)
- # immutant (29)
- # instaparse (21)
- # luminus (3)
- # off-topic (5)
- # onyx (5)
- # overtone (5)
- # pedestal (8)
- # re-frame (7)
- # reagent (6)
- # reitit (3)
- # schema (2)
- # shadow-cljs (178)
- # spacemacs (49)
- # specter (2)
- # sql (1)
- # tools-deps (110)
Ive tryed ring-handler in figwheel-main-edn as well as meta in dev.cljs.edn but same result. IS there any special options I need to get figwheel to compile clojure code aka server.clj?
yeah it is. its name is server.clj under same directory as the .cljs files. hmm mayb my directory has a hyphen in the edn does it need to be _? let me check
nope 😞 src ├── clj │ └── config_manager │ └── server.clj └── cljs └── config_manager ├── config.cljs ├── core.cljs ├── db.cljs ├── events.cljs ├── subs.cljs └── views.cljs figwheel_main {:log-syntax-error-style :concise :ring-handler config-manager.server/handler}
tryed with .clj in same directory as .cljs as well - yeah I have been basically just doing tutorial then moved onto your documentation
any command I should run? clojure -R:dev -A:fig -b dev -r 22:45:29 [Figwheel] Validating figwheel-main.edn [Figwheel] figwheel-main.edn is valid! Unable to find :ring-handler
sure been trying heaps of things out (ns config-manager.server (:require [http://clojure.java.io :as io] [bidi.ring :refer (make-handler)] [ring.util.response :as res] [compojure.core :refer :all] [compojure.route :as route] [ring.middleware.reload :refer [wrap-reload]] [ring.middleware.defaults :refer [wrap-defaults site-defaults]])) ;; define index content (def home “<!DOCTYPE html> <html> <head> <meta charset=\“UTF-8\“> <meta name=\“viewport\” content=\“width=device-width, initial-scale=1\“> <link href=\“css/style.css\” rel=\“stylesheet\” type=\“text/css\“> <link rel=\“icon\” href=\“https://clojurescript.org/images/cljs-logo-icon-32.png\“> </head> <body> <div id=\“app\“></div> <script src=\“/cljs-out/dev-main.js\” type=\“text/javascript\“></script> </body> </html>“) (defn handler2 [request] (if (and (= :get (:method request)) (= “/” (:uri request))) {:status 200 :headers {“Content-Type” “text/html”} :body home}} {:status 404 :headers {“Content-Type” “text/plain”} :body “Not Found”})) (defn index-handler [request] (res/response home)) (defn json-handler [request] (res/response (slurp (io/resource “public/dev.json”)) )) (def handler (make-handler [“/” {“index.html” index-handler “devq/” json-handler}])) (defroutes app-routes ;; NOTE: this will deliver all of your assets from the public directory ;; of resources i.e. resources/public (route/resources “/” {:root “public”}) ;; NOTE: this will deliver your index.html (GET “/” [] (-> (res/resource-response “index.html” {:root “public”}) (res/content-type “text/html”))) (GET “/json” [] json-handler) (route/not-found “Not Found”)) ;; NOTE: wrap reload isn’t needed when the clj sources are watched by figwheel ;; but it’s very good to know about (def dev-app (wrap-reload (wrap-defaults #’app-routes site-defaults)))
I'm going to record an issue that there needs to be feedback if there is an error when loading the file
quick? how to you do lein clean with clj? clojure -R:dev -A:fig -r 07:31:28 [Figwheel] Validating figwheel-main.edn [Figwheel] figwheel-main.edn is valid!
oh didnt know that looks like I have prob with some other file as keep getting same error
must be my deps file Im thinking. I dont need to add dependecies devtools, ring as you pull them in for lein? Ill move to figwheel-main
cant get past the above error i.e something screwy with my setup just seen that emacs hadnt created directory - so not sure what is going on at present.