This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-12
Channels
- # babashka (3)
- # beginners (9)
- # clojure (13)
- # clojure-dev (3)
- # clojure-europe (50)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (3)
- # clojurescript (3)
- # core-async (2)
- # dev-tooling (2)
- # honeysql (4)
- # hyperfiddle (2)
- # kaocha (1)
- # lsp (5)
- # off-topic (18)
- # polylith (4)
- # portal (2)
- # shadow-cljs (19)
- # squint (1)
- # vrac (1)
Can some please share resource for service-worker setup? I've tried with following build setup
{...
:builds {:app {:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:shared {:entries []}
:main {:init-fn testapp.core/main
:depends-on #{:shared}}
:service-worker {:init-fn testapp.service-worker/init
:web-worker true
:depends-on #{:shared}}}}}
}
and I'm getting error
main.js:1 Uncaught ReferenceError: SHADOW_ENV is not defined
at main.js:1:1
in multi module setups like that one you need to load shared.js
before main.js
in your HTML, so just two script tags instead of one
Upon bumping to 2.26.4
, there are complaints about a package: pako
The error reads:
package export wildcard match referenced a file that doesn't exist
{:rel-require "./lib/deflate", :package-dir #object[java.io.File 0x575218d0 "/node_modules/pako"], :prefix "./lib/", :match "./lib/*"}
The usage is:
(:require ["pako" :as pako])
…
(.deflate pako …)
The lib dir mentioned contains:
deflate.js inflate.js utils/ zlib/
Is this the same issue?
#14 40.26 package export wildcard match referenced a file that doesn't exist
#14 40.26 {:rel-require "./cjs/useCommittedRef", :package-dir #object[java.io.File 0x70a6c56b "/repo/node_modules/@restart/hooks"], :prefix "./", :match {"types" "./esm/*.d.ts", "import" "./esm/*.js", "require" "./cjs/*.js"}}
#14 40.26 ExceptionInfo: package export wildcard match referenced a file that doesn't exist
#14 40.26 shadow.build.npm/find-resource-from-exports-by-wildcard/fn--12475 (npm.clj:772)
#14 40.26 clojure.lang.ArraySeq.reduce (ArraySeq.java:114)
#14 40.26 clojure.core/reduce (core.clj:6885)
#14 40.26 clojure.core/reduce (core.clj:6868)
#14 40.26 shadow.build.npm/find-resource-from-exports-by-wildcard (npm.clj:761)
#14 40.26 shadow.build.npm/find-resource-from-exports-by-wildcard (npm.clj:759)
#14 40.26 shadow.build.npm/find-resource-from-exports (npm.clj:789)
#14 40.26 shadow.build.npm/find-resource-from-exports (npm.clj:785)
#14 40.26 shadow.build.npm/find-resource-in-package (npm.clj:803)
#14 40.26 shadow.build.npm/find-resource-in-package (npm.clj:793)
#14 40.26 shadow.build.npm/find-resource (npm.clj:885)
#14 40.26 shadow.build.npm/find-resource (npm.clj:848)
#14 40.26 shadow.build.resolve/find-npm-resource (resolve.clj:123)
#14 40.26 shadow.build.resolve/find-npm-resource (resolve.clj:94)
#14 40.26 shadow.build.resolve/eval13071/fn--13074 (resolve.clj:266)
#14 40.26 clojure.lang.MultiFn.invoke (MultiFn.java:244)
#14 40.26 shadow.build.resolve/find-resource-for-string (resolve.clj:81)
#14 40.26 shadow.build.resolve/find-resource-for-string (resolve.clj:70)
#14 40.26 shadow.build.resolve/resolve-string-require (resolve.clj:464)
#14 40.26 shadow.build.resolve/resolve-string-require (resolve.clj:447)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:700)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:693)
#14 40.26 shadow.build.resolve/resolve-deps/fn--13020 (resolve.clj:52)
#14 40.26 clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
#14 40.26 clojure.core/reduce (core.clj:6885)
#14 40.26 clojure.core/reduce (core.clj:6868)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:42)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:41)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:50)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:34)
#14 40.26 shadow.build.resolve/resolve-string-require (resolve.clj:489)
#14 40.26 shadow.build.resolve/resolve-string-require (resolve.clj:447)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:700)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:693)
#14 40.26 shadow.build.resolve/resolve-deps/fn--13020 (resolve.clj:52)
#14 40.26 clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
#14 40.26 clojure.core/reduce (core.clj:6885)
#14 40.26 clojure.core/reduce (core.clj:6868)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:42)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:41)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:50)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:34)
#14 40.26 shadow.build.resolve/resolve-string-require (resolve.clj:489)
#14 40.26 shadow.build.resolve/resolve-string-require (resolve.clj:447)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:700)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:693)
#14 40.26 shadow.build.resolve/resolve-deps/fn--13020 (resolve.clj:52)
#14 40.26 clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
#14 40.26 clojure.core/reduce (core.clj:6885)
#14 40.26 clojure.core/reduce (core.clj:6868)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:42)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:41)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:50)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:34)
#14 40.26 shadow.build.resolve/resolve-string-require (resolve.clj:489)
#14 40.26 shadow.build.resolve/resolve-string-require (resolve.clj:447)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:700)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:693)
#14 40.26 shadow.build.resolve/resolve-deps/fn--13020 (resolve.clj:52)
#14 40.26 clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
#14 40.26 clojure.core/reduce (core.clj:6885)
#14 40.26 clojure.core/reduce (core.clj:6868)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:42)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:41)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:50)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:34)
#14 40.26 shadow.build.resolve/resolve-symbol-require (resolve.clj:687)
#14 40.26 shadow.build.resolve/resolve-symbol-require (resolve.clj:647)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:697)
#14 40.26 shadow.build.resolve/resolve-require (resolve.clj:693)
#14 40.26 shadow.build.resolve/resolve-deps/fn--13020 (resolve.clj:52)
#14 40.26 clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
#14 40.26 clojure.core/reduce (core.clj:6885)
#14 40.26 clojure.core/reduce (core.clj:6868)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:42)
#14 40.26 shadow.cljs.util/reduce-> (util.clj:41)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:50)
#14 40.26 shadow.build.resolve/resolve-deps (resolve.clj:34)
#14 40.26 shadow.build.resolve/resolve-symbol-require (resolve.clj:687)
#14 40.26 shadow.build.resolve/resolve-symbol-require (resolve.clj:647)
@U05224H0W Yes, that’s the version. OK, weird. @UGNFXV1FA Yeah, that looks similar. Any idea what’s causing it?
I think I know. probably the change I did https://github.com/thheller/shadow-cljs/commit/e800cbccbb18588238d868d93c592dd38f21fc97 now locking things down too much
@U06B8J0AJ The output mentions "/repo/node_modules/@restart/hooks" so I guess it's related to that.
That one works again, thanks a lot @U05224H0W!