This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-10
Channels
- # announcements (4)
- # babashka (40)
- # beginners (39)
- # calva (16)
- # cljdoc (1)
- # cljs-dev (8)
- # clojure (72)
- # clojure-europe (10)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-spec (9)
- # clojure-uk (12)
- # clojurescript (16)
- # community-development (15)
- # conjure (5)
- # cursive (5)
- # datomic (26)
- # eastwood (1)
- # emacs (7)
- # events (1)
- # figwheel-main (15)
- # fulcro (27)
- # graphql (7)
- # gratitude (4)
- # introduce-yourself (1)
- # malli (4)
- # meander (4)
- # off-topic (2)
- # other-languages (13)
- # polylith (7)
- # reagent (5)
- # reitit (5)
- # shadow-cljs (27)
- # spacemacs (4)
- # sql (3)
- # tools-deps (6)
- # xtdb (13)
can you explain the troubleshooting section? why does commenting out :js-options
fix it or what error did it reveal? where is the rest of the stacktrace?
AssertionError Assert failed: (map? rc)
...
I’ll generate a full stack trace as soon as I get a chance. I don’t know why it was doing this. But it was a blocker to me until I figured out that was masking the real error.
(defn node-repl
[]
(shadow/node-repl {:config-merge [{:js-options {:js-package-dirs ["functions/node_modules"]}
,,,}]}))
Is this a valid thing to specify with node-repl
? We’ve split our package.json between frontend/backend recently and it looks like the node REPL isn’t able to find packages that only exist in the backend node_modules.Actually it looks like other parts of the build are also broken with a similar error 😅
(shadow/node-repl {:pwd "functions"})
so it runs the node repl process in the functions
dir
otherwise it runs in the project dir and since no node builds bundle any dependencies directly node
won't find them at runtime
ohh, that sounds like exactly what’s needed!
Should I keep the js-options
one around too? just with :pwd
I’m getting the same “cannot find module” errors as before
Maybe :pwd
isn’t working 😄
shadow-cljs can't find it or node cannot find it? two very different things with very different solutions
also note that if you had already startet a node-repl
that may still be running and running node-repl
again may just have reused that process?
:js-options
you need to keep if you have any (:require [a-symbol-pointing-to-npm-package ...])
to know that react
is actually meant to be a npm require if needs to check the package dirs
(:require ["react"])
does not need that check since it knows that string requires are not valid for CLJS namespaces
actually it is working! I accidentally passed it inside the config-merge
option instead of to shadow/node-repl
directly
I’m trying to control the logging of shadow-cljs by doing
--config-merge '{:closure-defines {shadow.cljs.devtools.client.env/log false}}'
I was expecting shadow-cljs: load JS something/something.cljs
logging to go away after looking at what seems to be relevant source code, but it’s still there. Am I supposed to be able to control this?Context: It’s a big app where many of the changes I make trigger very many such lines, and I’m mostly not interested in that info.