This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-05
Channels
- # announcements (9)
- # babashka (7)
- # beginners (190)
- # calva (5)
- # cider (12)
- # clara (1)
- # clj-kondo (26)
- # cljdoc (3)
- # cljsrn (5)
- # clojure (15)
- # clojure-australia (2)
- # clojure-czech (1)
- # clojure-europe (34)
- # clojure-germany (2)
- # clojure-nl (6)
- # clojure-spec (20)
- # clojure-uk (7)
- # clojurescript (6)
- # cloverage (2)
- # conjure (10)
- # core-async (18)
- # core-logic (1)
- # cursive (22)
- # data-science (1)
- # datalog (26)
- # datomic (35)
- # docker (1)
- # emacs (4)
- # etaoin (4)
- # fulcro (51)
- # jobs (2)
- # jobs-discuss (2)
- # joker (1)
- # leiningen (4)
- # mid-cities-meetup (1)
- # off-topic (22)
- # pathom (15)
- # re-frame (14)
- # reitit (5)
- # remote-jobs (1)
- # shadow-cljs (37)
- # specter (2)
- # tools-deps (43)
- # xtdb (2)
OK, so FWIW, I put the same minimal reproducible example up https://github.com/galagora/clonode. I couldn't get Figwheel to work either. I guess I'll just have to use something with better Node.js support, https://www.tweag.io/blog/2019-05-09-inline-js/ đ
ClassCastException: clojure.lang.KeywordLookupSite$1 incompatible with clojure.lang.Named
I keep getting these on shadow-cljs watch
ClassCastException: clojure.lang.KeywordLookupSite$1 incompatible with clojure.lang.Named
clojure.core/namespace (core.clj:1597)
clojure.core/namespace (core.clj:1597)
shadow.build.cljs-hacks/shadow-resolve-var (cljs_hacks.cljc:155)
shadow.build.cljs-hacks/shadow-resolve-var (cljs_hacks.cljc:147)
cljs.analyzer/resolve-existing-var (analyzer.cljc:1276)
cljs.analyzer/resolve-existing-var (analyzer.cljc:1271)
cljs.compiler/fn--9175 (cljs_hacks.cljc:740)
cljs.compiler/fn--9175 (cljs_hacks.cljc:717)
Anyone familiar with being able to use https://shoelace.style/getting-started/installation in a shadow-cljs project? I canât seem to just simply require components even though its shipped as an npm package. Do I need to do some webpack thing first? (their installation docs seem to imply that). Or is there some special path I need to use?
I have tried (:require ["@shoelace-style/shoelace" :refer [SlButton]])
and
(:requre ["@shoelace-style/shoelace" :as sl])
and I end up with nil for SlButton
or sl/SlButton
@devn do you maybe use shadow-cljs embedded in some CLJ app in combination with some kind of classloader magic or tools.namespace
?
I donât think thatâs my situation, but either way, do you have any suggestions for catching whatâs actually happening here?
@U05224H0W itâs not always inside the clojure core code.
I wish I could get a smaller way to reproduce, but:
The project has 3 primary source directories:
âsharedâ (cljc code)
âsrcâ (clojure code)
âui-srcâ (clojurescript code)
There is a project.clj which specifies all 3 of these source paths in its source-paths key. This project.clj requires the latest version of clojurescript.
In addition, there is a package.json and a shadow-cljs.edn. The shadow-cljs.edn has 3 builds in it, all of which are specified with :entries [the.ns]
@rberger read https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages about the default exports. I don't know for this case but it might be (:requre ["@shoelace-style/shoelace" :default SLButton])
@U05224H0W I was able to get it to import with:
(:require ["@shoelace-style/shoelace/dist/custom-elements/index.js" :refer [defineCustomElements setAssetPath SlButton]])
It ends up with an html custom element (web component) now I still have to figure out how to access the element after doing:
(.define js/customElements "sl-button" SlButton)
SlButton is defined as a class, but sl-button
is not defined. I probably just need to learn more how web components work with reagent.ah if its web components you just do [:sl-button ...]
like any other regular dom element
thats why the :refer
and stuff may not actually exist because you don't need it if it already self-registers
Oh, I didnât try with the :
Now that I try that, it
does inject <sl-button>⌠into the DOM now, but Iâm getting a
Uncaught ReferenceError: regeneratorRuntime is not defined
index.js:2654 Uncaught ReferenceError: regeneratorRuntime is not defined
at initializeComponent (index.js:2654)
at _connectedCallback (index.js:2944)
at HTMLElement.connectedCallback (index.js:3049)
at commitPlacement (react-dom.development.js:8835)
at commitAllHostEffects (react-dom.development.js:18656)
at HTMLUnknownElement.callCallback (react-dom.development.js:150)
at Object.invokeGuardedCallbackImpl (react-dom.development.js:200)
at invokeGuardedCallback (react-dom.development.js:257)
at commitRoot (react-dom.development.js:18914)
at eval (react-dom.development.js:20419)
But at least that is something I can track down now hopefully.
Thanks again for your help!
Oh, I didnât try with the(:require ["regenerator-runtime"])
should do it in case you didn't try .. you said "refer" which would be incorrect
Yep, (:require ["regenerator-runtime"])`` works great. Preferred to <script> tag Thanks again!
but from the package name I gather its about CSS which shadow-cljs does not handle. so it might be webpack only?
Is there any built-in way of combining watch
and release
? Basically just want a way of running release
every time the files change. watch
will call compile
on file change, as I understand it, so if there is a way of getting it to run release
instead?
not native to shadow in particular, but if you use watchman-make
you can do anything you want after files are changed e.g. watchman-make -p './src/***/**.cljs' -t release
https://facebook.github.io/watchman/docs/watchman-make.html
(where release
would be a target in your Makefile to run shadow-cljs release {target}
)
Thanks @U5RFD1733, I opted for the inotifywait
route as I already had that installed and didn't need to download anything new đ