This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-08
Channels
- # babashka (9)
- # beginners (43)
- # biff (4)
- # calva (11)
- # cider (6)
- # clerk (1)
- # clj-kondo (4)
- # cljs-dev (6)
- # clojure (82)
- # clojure-berlin (1)
- # clojure-europe (42)
- # clojure-nl (1)
- # clojure-norway (182)
- # clojure-quebec (1)
- # clojure-uk (19)
- # clojurescript (6)
- # datahike (1)
- # emacs (30)
- # fulcro (5)
- # honeysql (6)
- # hyperfiddle (12)
- # lambdaisland (8)
- # malli (11)
- # off-topic (36)
- # pathom (26)
- # pedestal (1)
- # portal (25)
- # practicalli (1)
- # rdf (29)
- # re-frame (17)
- # reitit (1)
- # releases (1)
- # sci (37)
- # shadow-cljs (15)
- # vim (10)
- # xtdb (13)
Hey folks, a newb clojurian here.
Does anyone here use neovim + conjure setup for cljs development using shadow-cljs?
I have been facing a problem where the js
namespace is not being found while evaluating the form. Would really appreciate any help.
Figured it out. For those who face the same issue: Apparently, we need to add the clojurescript support to the repl session by evaluating:
(ns my-namespace
(:require [shadow.cljs.devtools.api :as shadow-api]))
(shadow-api/repl :app) ; Where the `app` is the build-id defined in the shadow-cljs.edn
yeah, the js
namespace not being available suggests you are talking to a clojure REPL not clojurescript
I'd expect conjure to have a command to switch too? I don't use it though, so I don't know
Conjure has a ConjureShadowSelect
command. You pass build-id
to it and that's it. Worked for me every time 👍
Didn't know about ConjureShadowSelect
. This is awesome. Thanks @U09UWQCC9
On my phone ATM but there's a wiki page on the conjure repo for this too. Basically tells you about that command so you probably already have everything
Any gut reactions why moving from shadow-cljs 2.21.0 to 2.22.0 (1 step) would result in the error in the attached file? (it's super long i only looked at the first couple lines which repeat a tone due to a loop, then dive into some react stuff that i don't understand) This error is accompanied by the app being stuck at a loading screen, and so my intuition atm is to reimplement this loading screen in a different way. At one point, a very similar (probably the same) error pointed at this location in our code:
(defn resolve-routes
"Given a map of {<router-key>, <path-or-data>}, matches paths to handlers."
[router-paths]
(p/->> router-paths
(mapv (fn [[router-key path-or-data]]
(if (= :query router-key)
[router-key path-or-data]
(let [handler-data (match-route router-key path-or-data)
handler-data (update handler-data :route-params assoc :handler (:handler handler-data))]
(if-let [view-entry (get (:handlers @*index) (:handler handler-data))]
(p/let [view-entry (lazy/load-lazy view-entry)
view (lazy/load-lazy (:view view-entry))]
[router-key
(merge handler-data
view-entry
{:view view
:router router-key
:path path-or-data})])
(do (log/println :warn "missing handler for route" (:handler handler-data))
nil))))))
(p/all)
(into {})))
where p/all is [kitchen-async.promise :as p], and i suspect the issue is in how the promise is being handled.
Some other observations
• The error indicates something is stuck in a loop
• the error is saying that were calling apply on something which isn't defined inside the google promise library that was put on a queue... i think. But that's not close enough to the app for me to have any idea whats the right move here.
• I assume the most likely commit that result in our app having this hiccup is [ https://github.com/thheller/shadow-cljs/commit/5168aff39ddb21ddc5f6e18828456cc73c216e65 ], a closure compiler+lib bump
• my co-worker says it's working in safari but not chrome. (yikes!)
• I confirmed it works in firefox, so its likey only in chrome.
• this happens on the latest version of kitchen-asyncTypeError: Cannot read properties of undefined (reading 'apply')
this is basically a nullpointerexception if your are familiar with java
from the code above I cannot tell what that might be but there are various ways something can be nil/undefined
don't get to distracted by the code pointing to something inside closure code, that is only because something being undefined
being passed into it and it calling it