This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-12
Channels
- # admin-announcements (3)
- # announcements (1)
- # beginners (9)
- # boot (85)
- # bristol-clojurians (4)
- # cider (12)
- # cljs-dev (3)
- # clojure (91)
- # clojure-berlin (7)
- # clojure-dev (16)
- # clojure-italy (21)
- # clojure-russia (67)
- # clojure-spain (3)
- # clojure-uk (6)
- # clojurescript (139)
- # core-async (41)
- # cursive (7)
- # datomic (61)
- # editors (56)
- # events (16)
- # hoplon (11)
- # jobs (4)
- # ldnclj (14)
- # liberator (7)
- # off-topic (13)
- # om (5)
- # re-frame (22)
- # ring-swagger (27)
I am using client-side routing. What’s the appropriate way of issuing a 404?
@pupeno, we’re using something like this as our very last route to catch fall-throughs and display a 404 page, is that what you mean?
(defroute "/:anything-else" [anything-else]
(re-frame/dispatch [:set-active-panel :not-found])))
Sortof.
Sometimes the URL matches a route, but it’s still a 404. Nevertheless, that code doesn’t give the browser the 404 error, only displays the error. Correct?
So, I'm using re-frame 0.4.1
, with re-com 0.6.0
and seeing:
Compile Error
clojure.lang.ExceptionInfo : failed compiling file:src/cljs/homing_pigeon/views/hub.cljs
clojure.lang.ExceptionInfo : Referred var re-com.util/deep-merge does not exist
I see this deep-merge function: https://github.com/Day8/re-com/blob/0.6.0/src/re_com/util.cljs#L13
That’s true pupeno
The browser would still get a 200 response code. To change that you need to mess with the web server code (if you have one, for me it’s figwheel locally)
Although for us most of the time the browser doesn’t actually make a new request to the server
timgilbert: the server might not ever receive a request. I’m only interested in javascript/clojurescript generating a 404.
Well, the 404 is a status code on an http response
So without a server there’s no response
And a cookie is an http header but javascript can generate new ones. So, just the fact that it’s an http response it’s not in my mind enough to rule it out.
@escherize: tried cleaning the output files, doing a clean build?
I guess I’m just not clear on what you would expect to be reading that response
I think a cookie is more than just an http header, but 404 is only a http response code.
Yeah, apparently it’s impossible to tell the browser that the current URL is a 404 in JS.