Fork me on GitHub
#beginners
<
2021-04-16
>
Zaymon05:04:54

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

seancorfield05:04:56

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).

4
👀 4
jacekschae05:04:32

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

👀 5
👍 3
2
happyb3at10:04:57

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 [email protected] [email protected] 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) (

seancorfield17:04:21

@UTA54EFQF 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.

happyb3at18:04:12

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

3
Xarlyle016:04:59

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))))

seancorfield17:04:49

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

Xarlyle017:04:30

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

seancorfield17:04:09

Ah, sorry 😞

Xarlyle020:04:53

@U04V70XH6 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

seancorfield21:04:35

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

seancorfield21:04:35

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

Xarlyle021:04:07

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

seancorfield21:04:13

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

seancorfield21:04:34

muuntaja does that, I thought?

Xarlyle021:04:39

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ín22:04:22

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ín22:04:51

This is my navbar component:

Valentín22:04:13

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

Valentín22:04:40

An example of the object I want to link:

Valentín22:04:37

What am I doing wrong?

Drew Verlee22:04:21

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

Drew Verlee22:04:15

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

Valentín22:04:05

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

Valentín22:04:22

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