This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-22
Channels
- # announcements (1)
- # babashka (28)
- # beginners (120)
- # braveandtrue (6)
- # calva (59)
- # cider (10)
- # clj-kondo (10)
- # cljfx (2)
- # clojure (66)
- # clojure-europe (20)
- # clojure-germany (1)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-norway (1)
- # clojure-serbia (17)
- # clojure-spain (1)
- # clojure-uk (17)
- # clojurescript (120)
- # clojureverse-ops (4)
- # core-async (5)
- # cursive (18)
- # data-oriented-programming (1)
- # datomic (4)
- # deps-new (8)
- # emacs (14)
- # fulcro (16)
- # funcool (2)
- # kaocha (4)
- # lambdaisland (5)
- # luminus (1)
- # malli (47)
- # membrane (9)
- # mid-cities-meetup (2)
- # music (1)
- # off-topic (44)
- # pathom (13)
- # practicalli (2)
- # re-frame (15)
- # reagent (34)
- # reveal (25)
- # ring (56)
- # rum (1)
- # shadow-cljs (23)
- # sql (14)
- # startup-in-a-month (1)
- # tools-deps (10)
- # vim (9)
- # vscode (3)
- # xtdb (9)
I’m sending a post request with qualified keywords like so:
:http-xhrio {:method :post
:uri "/the-uri"
:params {:user/foo 1 :user/bar 1}
:on-success [:foo]
:on-failure [:bar]
:response-format (edn/edn-response-format)
:format (edn/edn-request-format)
}
And also using cljs-ajax library purely:
(ajax-request {:uri "/the-uri" :method :post :params {:user/foo 2 :user/bar 2} :handler (fn [res] (prn res)) :format (edn/edn-request-format) :response-format (edn/edn-response-format)})
In the former case, the incoming :params in the server aren’t namespace qualified, i.e., {:foo 1 :bar 2}
, whereas in the latter case they are, i.e., {:user/foo 1 :user/bar 2}
. Is this a bug in the re-frame-http-fx
library?is there a way to debug the cause?
Sure, same way you debug JavaScript. If you have sourcemaps set up correctly (which should be by default with at least shadow-cljs) and, perhaps, if you're using cljs-devtools, then you just open the relevant file in Chrome's devtools and set a breakpoint and go from there.
@U2FRKM4TW what are sourcemaps?
Any web search engine would give you a description that's better than anything I could come up with. It's a fundamental part of frontend development.
@U2FRKM4TW what port would I be able to debug at?
it’s a react native app
the packer is running on :8081. Would it be that one?
Ah, then I have zero clue. I'd search for how to debug React Native apps written in JavaScript. Then I'd transition that knowledge to ClojureScript.
where exactly should I put the breakpoint?
In the re-frame event handler? What would that tell me that I can’t find with print statements in my source?