This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-03
Channels
- # announcements (2)
- # asami (1)
- # babashka (32)
- # beginners (125)
- # calva (4)
- # cider (1)
- # clj-kondo (16)
- # clj-together (1)
- # cljs-dev (15)
- # clojure (30)
- # clojure-australia (3)
- # clojure-europe (41)
- # clojure-italy (1)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-spec (68)
- # clojure-uk (28)
- # clojurescript (36)
- # conjure (2)
- # cryogen (1)
- # cursive (2)
- # data-science (2)
- # datascript (2)
- # datomic (70)
- # events (2)
- # fulcro (11)
- # graalvm (1)
- # jobs (4)
- # kaocha (4)
- # leiningen (4)
- # malli (52)
- # meander (21)
- # off-topic (11)
- # pathom (7)
- # pedestal (17)
- # reagent (23)
- # reitit (5)
- # remote-jobs (5)
- # reveal (7)
- # shadow-cljs (24)
- # spacemacs (36)
- # sql (21)
- # vim (18)
- # xtdb (7)
using a npm package with "main": "dist/index.umd.js"
throws some error like Cannot read property 'createGenerator' of undefined
, but it works if I use the esm instead. is that expected? can't find any mention of the difference in the user guide
this package also has a "module": "dist/index.esm.js" in package.json which shadow-cljs seemed to ignore, preferring the umd
@kevin842 it is intentional that it defaults to using main
. compatibility is much better since not all packages provide module
and mixing has been a nightmare in the past. it can work but it largely depends on the packages you use. can't say much about the createGenerator
error without more information. you can make it use module
via setting :js-options {:entry-keys ["module" "browser" "main"]}
in the build config, the reverse is the default.
ah, nice. didn't see :entry-keys mentioned anywhere. I don't know what createGenerator is doing, but I guess you've seen different behavior with umd/esm? JS packaging seems like a real nightmare
If i’m using :shadow {:main-opts ["-m" "shadow.cljs.devtools.cli"]}
in my deps.edn
to watch a build, should I get a REPL after navigating to my app? I remember getting this but haven’t seen it in awhile, and have been having issues connecting my editor and figured this was a good place to start.
OK, I was following the Fireplace instructions via the Guide and when I try doing :CljEval (shadow/repl :my-app)
it says shadow
isn’t defined
Unfortunately using the full namespace actually creates a REPL prompt as the output, but doesn’t connect my editor 😅
or you need to load the shadow-cljs nrepl middleware in the one you are connected to
i’m using :nrepl {:port 51468}
in my shadow-cljs.edn, so it should be the right one, since I explicitly connect to that port.
if you are connecting to the actual shadow-cljs nrepl server you don't need to worry about it. that will definitely have the middleware configured.
Any other suggestions for debugging this? Asking another colleague seems like what we used to use for connecting via emacs isn’t working either
The error they’re getting is :missing-nrepl-middleware
, so that is something outside shadow?
that means you are definitely NOT connected to the nrepl server shadow-cljs provides
confirmed that I can connect using clj -Sdeps '{:deps {nrepl {:mvn/version "0.8.3"}}}' -m nrepl.cmdline --connect --host localhost --port 33333
, upgrade via (shadow/repl :my-app)
, so yeah, it seems like an nrepl connection issue. Thanks for taking a look, I’ll try to debug from here.