This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-06
Channels
- # aleph (43)
- # announcements (11)
- # babashka (35)
- # beginners (70)
- # calva (4)
- # cider (8)
- # clerk (15)
- # clojure (192)
- # clojure-dev (7)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-norway (65)
- # clojure-uk (4)
- # code-reviews (4)
- # conjure (1)
- # cursive (41)
- # data-science (1)
- # datomic (8)
- # emacs (7)
- # fulcro (13)
- # humbleui (17)
- # hyperfiddle (53)
- # kaocha (4)
- # malli (7)
- # missionary (17)
- # music (1)
- # obb (1)
- # off-topic (8)
- # polylith (1)
- # portal (3)
- # releases (11)
- # shadow-cljs (36)
- # squint (4)
- # tools-deps (4)
I'm currently encountering an issue with my Shadow CLJS project where I get an Uncaught ReferenceError: shadow$bridge is not defined
error. I believe this problem is related to my configuration for external JavaScript dependencies and tree shaking. I am attempting to apply tree shaking to reduce the size of my npm dependencies in the build output. Trying for release mode. npx shadow-cljs watch app
Below is the relevant part of my Shadow CLJS configuration:
:builds {:app {:target :browser
:output-dir "resources/public/js/compiled"
:asset-path "/js/compiled"
:modules {:app {:init-fn my-app.ui.core/init}}
:js-options {:js-provider :external
:external-index "target/index.js"
:external-index-format :esm}
:dev {:compiler-options {:closure-defines {re-frame.trace.trace-enabled? true
day8.re-frame.tracing.trace-enabled? true}
:warnings {:redef false}}}
:release {:build-options {:ns-aliases {day8.re-frame.tracing day8.re-frame.tracing-stubs}}}}}
I'm trying to use the :external-index-format :esm
to generate ESM code, but I'm facing an issue where the shadow$bridge
function seems to be missing or not properly exported, as indicated by the error message.
The error I receive is:
Uncaught ReferenceError: shadow$bridge is not defined
;var tE = shadow$bridge("react");
I would greatly appreciate any insights or suggestions on what might be causing this issue and how to resolve it.I've moved target/index.js
into my resources folder and updated index.html like this;