This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-31
Channels
- # aleph (12)
- # announcements (4)
- # asami (7)
- # babashka (20)
- # beginners (92)
- # calva (74)
- # clj-kondo (8)
- # cljdoc (70)
- # clojure (47)
- # clojure-dev (29)
- # clojure-europe (27)
- # clojure-nl (7)
- # clojure-norway (3)
- # clojurescript (7)
- # cursive (2)
- # datomic (1)
- # emacs (8)
- # events (5)
- # fulcro (36)
- # gratitude (4)
- # humbleui (25)
- # introduce-yourself (1)
- # lsp (26)
- # malli (6)
- # missionary (8)
- # nbb (50)
- # off-topic (9)
- # pathom (2)
- # pedestal (3)
- # portal (32)
- # practicalli (5)
- # reitit (5)
- # releases (1)
- # ring (6)
- # shadow-cljs (87)
- # sql (31)
- # tools-deps (26)
- # vim (3)
- # xtdb (15)
else https://github.com/babashka/nbb/tree/main/doc/bundle is still an option. This produces a single .mjs
file where all .cljs
is inlined into a single file, so no .nbb
necessary
$ node card-get.mjs
file:///home/ray/fc/repos/card-main/node_modules/nbb/lib/nbb_core.js:2214
2,null),new $APP.G(null,jt,new $APP.G(null,new $APP.G(null,$APP.Ul,new $APP.G(null,D,null,1,null),2,null),null,1,null),2,null),3,null),4,null),5,null),6,null)):null}finally{$APP.Wq()}}).then(function(){var P=$APP.z(a);return hx.h?hx.h(P,b):hx.call(null,P,b)}):Promise.reject(Error(["Could not find namespace: ",$APP.p.g(q)].join("")))}return Promise.resolve($APP.U.g(b))};
^
Error: Could not find namespace: camel-snake-kebab.core
at hx (file:///home/ray/fc/repos/card-main/node_modules/nbb/lib/nbb_core.js:2214:276)
at file:///home/ray/fc/repos/card-main/node_modules/nbb/lib/nbb_core.js:2214:244
at async file:///home/ray/fc/repos/card-main/card-get.mjs:5:21
I think when going through the JS API, it doesn't add the .nbb
stuff.
You can fix this by adding addClassPath(".nbb/.cache/e4754d38932a5ba3dcbfe8a138680e6ec55900db/nbb-deps")
manually for now.
Issue welcome
next time you can also use getClassPath
to print the current classpath, for debugging
yes:
import { addClassPath, getClassPath, loadFile } from 'nbb';
addClassPath("src")
addClassPath(".nbb/.cache/e4754d38932a5ba3dcbfe8a138680e6ec55900db/nbb-deps")
const { handler } = await loadFile('./src/card_get.cljs');
export { handler }
I much prefer to write code like this
function patch() {
sed -e "s?\(^addClassPath.*\)?\1\n${extra_classpath}?" $1
}
Btw, there's also plenty npm deps that can do the kebab thing: https://www.npmjs.com/package/kebab-case
anyway ... it's a fun adventure to find all the nooks and crannies a week before the project goes live
@U04V5V0V4 Fixed in 1.0.140