This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-09
Channels
- # announcements (4)
- # babashka (16)
- # beginners (4)
- # calva (19)
- # cider (61)
- # clj-commons (3)
- # clj-kondo (8)
- # clojure (68)
- # clojure-boston (1)
- # clojure-brasil (1)
- # clojure-europe (16)
- # clojure-hungary (2)
- # clojure-nl (1)
- # clojure-norway (39)
- # clojure-spec (2)
- # clojure-uk (4)
- # clojuredesign-podcast (16)
- # clojurescript (17)
- # core-typed (7)
- # cursive (17)
- # data-science (7)
- # datalevin (19)
- # datomic (1)
- # events (6)
- # hyperfiddle (6)
- # kaocha (9)
- # london-clojurians (2)
- # malli (10)
- # off-topic (1)
- # other-languages (24)
- # portal (2)
- # practicalli (19)
- # rdf (1)
- # reitit (2)
- # releases (2)
- # shadow-cljs (18)
- # testing (1)
- # xtdb (20)
- # yamlscript (4)
Hi, I'm having an weird problem. I'm working with ClojureScript to do plug-ins for an editor - meaning I can have two, or more, Shadow-CLJS compiled code running at the editor. They are all running in release mode, but they are all compiled with --pseudo-names
because it's easier to debug issues when they happened.
But - one of the plug-ins don't work when I compile with --pseudo-names
- it gives me the error Error: No protocol method IPromise.-merr defined for type object: [object Promise]
(I'm using Promesa, double and triple checked that I don't have multiple Promesa versions in my path). Anyone had a similar problem?
I have no idea if that's related, but I remember having the same problem when I used Atom in the past (without Shadow) and I did solve by adding :output-wrapper true
. Shadow's documentation says that this option is only relevant for the browser target, and I did try to add it in my config, and it didn't change the output;
I also found that Shadow generates a var shadow$provide = {};
in the top-level; again, not sure if it's relevant...
:target :browser
or whatever else that lives in the global scope will be a problem as some "glue" code such as shadow$provide
needs to be global
So it seems that multiple release builds with pseudo-names are conflicting with each other? Is that possible?
or are you trying to pass one CLJS object from one build to another? that'll not work since they are different "types"
Yes, I'm using :js-provider :shadow
(and no, I'm not trying to pass one CLJS object from one build to another, it's just two builds that use promesa in different versions that are somehow conflicting with each other because both extend the Promise
Javascript object)
well since its extending the js Promise type the protocol might override each other I guess
and in cljs things use the cljs.core/PROTOCOL-SENTINEL
to verify that something actually implements the protocol. since that will be different objects for each build, they basically overwrite each other
That makes a lot of sense, thanks for the help!
Never though about the implications of pseudo-names, good to know