beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
Zaymon 2021-04-16T05:10:54.172600Z

Hi all. Are people still using buddy-auth? What about for apps that use reitit for routing? Any promising alternatives?

seancorfield 2021-04-16T05:16:56.174Z

I think the general consensus is that the various Buddy submodules are fine to use in production (although it's confusing that the root repo seems to be unmaintained).

1👀1✅
jacekschae 2021-04-16T05:50:32.174700Z

There is a reitit-buddy-auth example in the repo https://github.com/metosin/reitit/tree/master/examples/buddy-auth

1👍1👀
Zaymon 2021-04-18T10:28:31.201800Z

Thanks!

happyb3at 2021-04-16T10:16:57.175800Z

How to debug this error? I create a brand new project but get IllegalArgumentException: no conversion to symbol Clojure lein new re-frame duck Retrieving re-frame/lein-template/2.1.2/lein-template-2.1.2.pom from clojars Retrieving re-frame/lein-template/2.1.2/lein-template-2.1.2.jar from clojars Generating re-frame project. ➜ Clojure cd duck  ➜ duck shadow-cljs run shadow-cljs - config: /home/hovgaard/Clojure/duck/shadow-cljs.edn shadow-cljs - updating dependencies Retrieving thheller/shadow-cljs/2.12.5/shadow-cljs-2.12.5-aot.jar from https://repo.clojars.org/ shadow-cljs - dependencies updated running: npm install --save --save-exact react@17.0.1 react-dom@17.0.1 added 101 packages, and audited 102 packages in 2s 3 packages are looking for funding  run npm fund for details found 0 vulnerabilities IllegalArgumentException: no conversion to symbol        clojure.core/symbol (core.clj:596)        clojure.core/symbol (core.clj:589)        shadow.cljs.devtools.cli-actual/do-clj-run (cli_actual.clj:70)        shadow.cljs.devtools.cli-actual/do-clj-run (cli_actual.clj:65)        shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:126)        shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:116)        shadow.cljs.devtools.cli-actual/main (cli_actual.clj:177)        shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)        clojure.core/apply (core.clj:669)        clojure.core/apply (core.clj:660)        shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)        shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)        clojure.lang.Var.applyTo (Var.java:705)        clojure.core/apply (core.clj:665)        clojure.core/apply (core.clj:660)        shadow.cljs.devtools.cli/-main (cli.clj:75)        shadow.cljs.devtools.cli/-main (cli.clj:67)        clojure.lang.Var.applyTo (Var.java:705)        clojure.core/apply (core.clj:665)        clojure.main/main-opt (main.clj:514)        clojure.main/main-opt (main.clj:510)        clojure.main/main (main.clj:664)        clojure.main/main (main.clj:616)        clojure.lang.Var.applyTo (Var.java:705)        clojure.main.main (main.java:40) duck clojure --version Clojure CLI version 1.10.3.822 duck java --version openjdk 11.0.10 2021-01-19 OpenJDK Runtime Environment 18.9 (build 11.0.10+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9, mixed mode, sharing) (

Xarlyle0 2021-04-16T16:34:59.178700Z

Hello! I'm trying to use the basic swagger ui using reitit-swagger-ui but the webpage gives me an error and I just can't seem to figure out why. I'm generally copying from this project: https://github.com/metosin/reitit/blob/master/examples/ring-swagger/src/example/server.clj And the code is this:

(def app
  (ring/ring-handler
   (ring/router
    [["/swagger.json"
      {:get {:no-doc true
             :swagger {:id "2.0"
                       :info {:title "my-api"
                              :description "something"}}
             :handler (swagger/create-swagger-handler)}}]
     ["/api"
      {:swagger {:id :my-api}}

      ["/checkImage"
       {:post {:summary ""
               :parameters {:multipart {:file multipart/temp-file-part}}
               :responses {200 {:body {:errors true}}}
               :swagger {:consumes ["image/jpg"]}
               :handler checkImage}}]]]
    {:data {:middleware [swagger/swagger-feature
                         multipart/multipart-middleware]}})
   (ring/routes
    (swagger-ui/create-swagger-ui-handler
     {:path "/"})
    (ring/create-default-handler))))

seancorfield 2021-04-16T17:04:21.178900Z

@alan.hovgaard I suspect shadow-cljs is expecting a more recent version of Clojure (the language itself, not the CLI script). Check project.clj and see what version of org.clojure/clojure it has specified.

seancorfield 2021-04-16T17:06:49.179100Z

@xarlyle0 you may need to ask in #ring-swagger or #reitit if you don’t get a response here within another 30 minutes…

Xarlyle0 2021-04-16T17:08:30.179300Z

Already asked in #reitit some hours ago. Thought someone here might know by chance

seancorfield 2021-04-16T17:25:09.179600Z

Ah, sorry 😞

2021-04-16T18:06:12.179900Z

95% of my fnil usage is either (fnil conj []) or (fnil conj #{})

1👍1
happyb3at 2021-04-16T18:10:12.180100Z

shadow-cljs watch app work fine... I used "shadow-cljs run" which needs more args. thx to thheller who replied in shadow-cljs channel. .. thx for reply seancorfield

1
Xarlyle0 2021-04-16T20:58:53.180900Z

@seancorfield It's interesting. I'm looking deeper into this and when I replace the "/swagger.json" endpoint with this:

["/swagger.json" {:get {:handler (constantly {:status 200 :body "{\"swagger\": \"2.0\", \"x-id\": \"something\", \"paths\": {\"/api/checkImage\": {\"get\": {}}} }"})}}]
It works in a basic sense. But the output of things like the reitit swagger handler and the ring-swagger lib produces strings like this:
[:swagger "2.0"][:info {:title "Something", :version "1.0.0", :description ""}][:produces ["application/json"]][:consumes ["application/json"]][:paths {"/api/checkImage" {:post {:responses {:default {:description ""}}}}}][:definitions {}]
Swagger seems to want an actual JSON formatted text, but all these APIs don't produce that. This is baffling

seancorfield 2021-04-16T21:00:35.181100Z

No idea, sorry. I’ve never used Reitit (or Swagger).

seancorfield 2021-04-16T21:01:35.181300Z

That latter output looks like something is turning a hash map into a seq though.

Xarlyle0 2021-04-16T21:03:07.181500Z

Okay. I think it's looking like I'm missing a middleware to change the data returned by these APIs into JSON format. Though none of the examples on reitit's docs specify you need this.. weird

seancorfield 2021-04-16T21:03:13.181700Z

You might also want to compare your list of middleware against what’s in that example project — in case something is mi… yup.

seancorfield 2021-04-16T21:03:34.181900Z

muuntaja does that, I thought?

Xarlyle0 2021-04-16T21:03:40.182100Z

I think so

Xarlyle0 2021-04-16T21:21:39.182700Z

Okay that worked! Though I'm not sure which of those middlewares were the actual one I was missing. I will suggest this be added to the docs on #reitit

Valentín 2021-04-16T22:05:48.183400Z

Hi guys

Valentín 2021-04-16T22:06:22.183600Z

I’m working on a web application. I want to link the menu options, to specific part of the page (in-page navigation) I’m having a problem, when I click the links of the menu, they are doing nothing…

Valentín 2021-04-16T22:06:51.183900Z

This is my navbar component:

Valentín 2021-04-16T22:07:13.184100Z

Links [“nosotros” “historia” “productos”]

Valentín 2021-04-16T22:07:40.184400Z

An example of the object I want to link:

Valentín 2021-04-16T22:08:37.185100Z

What am I doing wrong?

2021-04-16T22:28:21.185500Z

@vfernandez11 shouldn't there be something before the pound symbol?

2021-04-16T22:30:15.186500Z

e.g i'm seeing what you have as #<link> when what i imagine you need is <link>#section

Valentín 2021-04-16T22:48:05.186700Z

In my case <link> is just the id of the :h1

Valentín 2021-04-16T22:52:22.186900Z

If I link to another site eg https://www.google.com/ it's works well, but when use an anchor tag, the link do nothing