Fork me on GitHub
#reitit
<
2020-07-13
>
abdullahibra08:07:04

Hi everyone, 👆

abdullahibra13:07:16

How can this simple example be improved to add better handling of invalid inputs?

jlmr15:07:34

Hi, I’m setting up reitit with re-frame, basically following this example: https://github.com/metosin/reitit/blob/master/examples/frontend-re-frame/src/cljs/frontend_re_frame/core.cljs I’ve also setup the backend to serve index.html on all relevant matches. Navigating on the frontend side of things seems to work correctly, but how can I get it so that the frontend routing triggers when a user refreshes the page?

valtteri16:07:25

Hi @jlmr! As far as I know it should just work. If you’re on http://localhost:3449/#/sub-page2 and refresh, it should print out to console > initializing routes > Entering sub-page 2

valtteri16:07:45

Or did you expect something else? 😮

valtteri16:07:04

You said you’re returning index.html on all relevant matches. Can you confirm that it’s actually returning index.html with the route you’re requesting?

valtteri16:07:44

Are you trying with or without # in the url?

abdullahibra16:07:06

@valtteri can you help about my issue 🙂 ?

valtteri16:07:52

Sorry @abdullahibra I don’t know Pedestal. 😕 But with a quick look it looks like you may have a bad version of Jackson pulled in and that might cause the 500 errors you’re seeing?

valtteri16:07:59

(I remember vaguely that I had to pin Jackson dependencies to certain versions at some point but I thought this was fixed a long time ago…)

valtteri16:07:45

I might be completely wrong also.

valtteri16:07:03

I can give it a try…

abdullahibra16:07:13

for math post, just change x to string

valtteri16:07:08

Yeah, it gives the nasty 500

valtteri16:07:02

When I run lein deps :tree | grep jackson I can see that some jackson deps have different version

[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.9.0"]
     [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.9.0"]
   [com.fasterxml.jackson.core/jackson-core "2.11.0"]
   [com.fasterxml.jackson.core/jackson-databind "2.11.0"]
     [com.fasterxml.jackson.core/jackson-annotations "2.11.0"]
       [com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.11.0"]

valtteri16:07:07

This might cause issues

valtteri16:07:33

But dunno.. I need to run now, but hope you get it fixed!

abdullahibra17:07:07

Thank you 🙂

jlmr18:07:54

@valtteri Thanks! I’m trying without the # and so far it doesn’t work unfortunately