This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-28
Channels
- # aleph (16)
- # announcements (7)
- # asami (4)
- # aws (26)
- # babashka (26)
- # babashka-sci-dev (50)
- # beginners (118)
- # biff (7)
- # calva (15)
- # cider (6)
- # clj-kondo (8)
- # cljs-experience (3)
- # clojure (30)
- # clojure-austin (26)
- # clojure-europe (20)
- # clojure-france (2)
- # clojure-ireland (1)
- # clojure-nl (3)
- # clojure-norway (2)
- # clojure-spec (7)
- # clojure-uk (6)
- # clojurescript (12)
- # community-development (5)
- # conjure (1)
- # copenhagen-clojurians (3)
- # core-typed (71)
- # cursive (3)
- # datomic (1)
- # emacs (4)
- # fulcro (2)
- # helix (2)
- # introduce-yourself (3)
- # jobs (1)
- # london-clojurians (6)
- # lsp (122)
- # malli (2)
- # missionary (5)
- # overtone (14)
- # pathom (4)
- # polylith (1)
- # reagent (4)
- # reitit (1)
- # releases (1)
- # shadow-cljs (80)
- # testing (10)
- # tools-deps (6)
- # vim (3)
- # xtdb (19)
DOMException: The operation is insecure.
The above error occurred when loading "shadow.cljs.devtools.client.browser.js".
@raymcdermott unless you are including it manually somehow this should not be part of a release build. neither should a file of that name? you sure you are loading the release build files?
release builds only have one file per module, not one file per namespace. unless this is a :npm-module
build?
Hi, I am trying to get my project working on MacOS and I have discovered the following strange behaviour. When I connect to Shadow-cljs nREPL and switch to the browser target, I can run (js/console.log "Test") fine, but when running (js/alert "Test"), I get the following error: Execution error (ReferenceError) at (<cljs repl>:1). alert is not defined => :repl/exception! Similarly for js/document and others.
yes, I am running some web workers
you can see the runtime ids listed at http://localhost:9630/runtimes
and pick which one to connect to via (shadow/repl :the-build-id {:runtime-id that-id-number})
yes, this works fine
any way to set up the default runtime-id?
can I list all build ids in REPL?
runtime-ids
ok, cool, I can write some wrapper for that which will connect me to the correct REPL
plus it is useful to be able to search this when running in multiple browsers, etc.
thanks
What target is recommended when you want to build a chrome extension? I'm trying with browser but I got:
if (!doc) {
throw new Error("browser bootstrap used in incorrect target");
}
haven't looked at browser extensions for many years now. dunno what that looks like now
I have tried both already. :esm
gives me "cannot import module" or something and :chrome-extension
gives me a "Cannot find manifest.edn" stacktrace in the console.
The ESM route I've already read some things about, it consists of workarounds, but I think that because the compiled .js loads other .js files makes it more complicated. I could just work with optimizations simple maybe. The other one, I'll reproduce now.
(here is some background on the ESM stuff: https://medium.com/front-end-weekly/es6-modules-in-chrome-extensions-an-introduction-313b3fce955b)
[:modules] Configuring build.
[:modules] Build failure:
FileNotFoundException: manifest.edn (No such file or directory)
java.io.FileInputStream.open0 (FileInputStream.java:-2)
java.io.FileInputStream.open (FileInputStream.java:219)
java.io.FileInputStream.<init> (FileInputStream.java:157)
(io.clj:229)
(io.clj:229)
(io.clj:69)
(io.clj:165)
(io.clj:165)
(io.clj:69)
(io.clj:102)
(io.clj:86)
clojure.core/apply (core.clj:669)
clojure.core/slurp (core.clj:7009)
clojure.core/slurp (core.clj:7009)
shadow.build.targets.chrome-extension/configure (chrome_extension.clj:59)
shadow.build.targets.chrome-extension/configure (chrome_extension.clj:48)
shadow.build.targets.chrome-extension/process (chrome_extension.clj:310)
shadow.build.targets.chrome-extension/process (chrome_extension.clj:305)
clojure.lang.Var.invoke (Var.java:384)
shadow.build/process-stage/fn--14625 (build.clj:161)
shadow.build/process-stage (build.clj:158)
shadow.build/process-stage (build.clj:150)
shadow.build/configure (build.clj:389)
shadow.build/configure (build.clj:274)
shadow.cljs.devtools.server.worker.impl/build-configure (impl.clj:205)
shadow.cljs.devtools.server.worker.impl/build-configure (impl.clj:156)
shadow.cljs.devtools.server.worker.impl/do-config-watch (impl.clj:571)
shadow.cljs.devtools.server.worker.impl/do-config-watch (impl.clj:565)
shadow.cljs.devtools.server.util/server-thread/fn--15932/fn--15933/fn--15941 (util.clj:269)
shadow.cljs.devtools.server.util/server-thread/fn--15932/fn--15933 (util.clj:268)
shadow.cljs.devtools.server.util/server-thread/fn--15932 (util.clj:241)
java.lang.Thread.run (Thread.java:829)
{:deps true
:dev-http {7778 ["classpath:public"]}
:builds
{:modules
{:js-options {;; don't bundle any npm libs
:js-provider :import}
:compiler-options {:infer-externs :auto}
:target :chrome-extension
:output-dir "resources/public/js"
:modules
{:nrepl_extension {:init-fn nrepl-extension.core/init}
}
:build-hooks [(shadow.cljs.build-report/hook
{:output-to "report.html"})
]}}}
> thats not how that works Oops sorry, I kind of relied on the spec checking that shadow-cljs does in various other places :)
btw :compiler-options {:infer-externs :auto}
has been the default for quite some time now. you never need to set it.
here seems to be a newer example: https://github.com/binaryage/chromex/blob/master/examples/shadow/shadow-cljs.edn
but I believe chrome has a new manifest version that is apparantly different but I didn't look at that at all yet
since I already noticed some deprecation warnings with a v2 extension I wrote in JS once :(
I can live with no REPL to get this bootstrapped. I'm developing an nREPL server in the browser...
so I need to open a tcp port in the browser and the only way seems to make an extension
:target :esm
is absolutely the way to go now and is fully supported. just may need to set "type":"module"
in some places apparently
it should also properly support modules loading other modules so all the extra hacks :chrome-extension
did to sometimes create standalone files should not be needed anymore
just content-scripts
still seem to be a bit more limited, although might just work too
@U05224H0W I will try to get back on the ESM track, but I haven't seen an up to date example with a service_worker .js script that directly works as an ES6 module. Have you?
They have a tcpserver example here: https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/apps/samples/tcpserver
> This API is part of the deprecated Chrome Apps platform. Learn more about migrating your app.
@U04V15CAJ Howâs your progress on your chrome extension?
@UGC0NEP4Y I stepped away from that since extensions do not allow you to open TCP ports. I solved my problem in a different way that doesn't require an extension