This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-24
Channels
- # announcements (6)
- # babashka (25)
- # beginners (52)
- # cherry (8)
- # cider (9)
- # clj-kondo (9)
- # clojure (44)
- # clojure-australia (5)
- # clojure-dev (4)
- # clojure-europe (8)
- # clojure-nl (5)
- # clojure-norway (3)
- # clojure-spec (3)
- # clojure-uk (1)
- # clojurescript (16)
- # conjure (1)
- # core-async (8)
- # cursive (11)
- # fulcro (13)
- # honeysql (6)
- # hyperfiddle (13)
- # jackdaw (1)
- # jobs (9)
- # lsp (13)
- # meander (5)
- # missionary (2)
- # off-topic (11)
- # polylith (11)
- # re-frame (2)
- # reitit (11)
- # shadow-cljs (69)
- # squint (23)
- # tools-deps (30)
- # xtdb (3)
I have a small reagent app that I run/build through shadow-cljs. I am trying to add some small routing functionality with reitit-frontend. The routing works correctly when running my dev build but then breaks in the production release. I get a 404 whenever I go to any route outside of the root one. Any clue why that might be happening?
Here is the repo, with almost all the functionality happening in core.cljs
: https://github.com/Chase-Lambert/homepage/blob/main/src/homepage/core.cljs which I mostly adapted from the reitit frontend easy example.
I also noticed the routing doesn't work in the dev build when I had {:use-fragment true}
either.
if you don't use fragment it's a real URL routing that's happening so i'm not surprised it fails. The real question is, why doesn't use-fragment work in dev ?
Basically the website is for my programming related stuff where I'm practicing learning Reagent and such so I want it to be a SPA, but I want to be able to send some people (my English students) to a specific part of the website (`/teaching`) that's separate from the other stuff on the site. Is reitit-frontend
maybe not a good way to accomplish that?
Wait a second. So I actually ran the reitit frontend example to hopefully better understand how it works and noticed the url includes a #
in between the root url and the route. Putting that same #
in my url obviously works too. So it's been working this whole time. Oof. hahaha. Oh man. I'm probably really showing my web dev naivete here. I obviously didn't quite understand what the docs were telling me when researching what that whole use-fragment
thing was signifying.