This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-27
Channels
- # aleph (5)
- # announcements (18)
- # beginners (200)
- # cider (25)
- # cljdoc (4)
- # cljsrn (3)
- # clojure (90)
- # clojure-europe (3)
- # clojure-finland (5)
- # clojure-france (1)
- # clojure-houston (1)
- # clojure-italy (8)
- # clojure-nl (15)
- # clojure-spec (24)
- # clojure-uk (20)
- # clojurescript (199)
- # core-async (2)
- # cursive (45)
- # data-science (14)
- # datomic (33)
- # duct (13)
- # fulcro (4)
- # graphql (3)
- # kaocha (9)
- # leiningen (24)
- # nrepl (16)
- # off-topic (105)
- # pathom (15)
- # pedestal (28)
- # re-frame (1)
- # reagent (14)
- # shadow-cljs (28)
- # spacemacs (8)
- # tools-deps (8)
- # vim (4)
hi everybody, I have a problem with my shadow-cljs project. I am trying to use carbon-react
, so these are the steps I did:
- yarn add react react-dom create-react-class carbon-react
- yarn
Then I used its components:
(ns carbon-example.dashboard.views
(:require ["carbon-react/lib/components/app-wrapper" :as AppWrapper]
["carbon-react/lib/components/navigation-bar" :as NavigationBar]
[re-frame.core :as rf]))
(defn- navbar
[]
(fn []
[:> NavigationBar]))
(defn panel
[]
(fn []
[:> AppWrapper
[navbar]]))
But shadow-cljs compile carbon-example
doesn't work:
shadow-cljs - config: /home/manuel/7bridges/code/carbon-example/shadow-cljs.edn cli version: 2.8.24 node: v8.15.1
[:carbon-example] Compiling ...
The required JS dependency "core-js/modules/es7.symbol.async-iterator" is not available, it was required by "node_modules/carbon-react/lib/components/app-wrapper/app-wrapper.js".
Searched in:/home/manuel/7bridges/code/carbon-example/node_modules
You probably need to run:
npm install core-js/modules/es7.symbol.async-iterator
See:
This is my shadow-cljs.edn
file:
{:builds
{:carbon-example {:asset-path "/js"
:modules {:main {:entries [carbon-example.core]}}
:output-dir "resources/public/js"
:target :browser}}
:dependencies [,,,]
:dev-http {8020 "resources/public/"}
:devtools {:http-root "resources/public"
:http-port 8020}
:nrepl {:middleware [refactor-nrepl.middleware/wrap-refactor]
:port 8777}
:source-paths ["src"]}
@manuel I'd guess that that is a version conflict somewhere, or just a missing peer dep
did you see this message?
npm WARN [email protected] requires a peer of flux@^3.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of i18n-js@^3.0.0 but none is installed. You must install peer dependencies yourself.
running npm ls
, the problem seems to be:
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
An old version of core-js
.but I also have [email protected]
installed
I did:
- yarn add [email protected]
- shadow-cljs compile carbon-example
Now I get:
shadow-cljs - config: /home/manuel/7bridges/code/carbon-example/shadow-cljs.edn cli version: 2.8.24 node: v8.15.1
[:carbon-example] Compiling ...
failed to resolve: ../../utils/helpers/tags from /home/manuel/7bridges/code/carbon-example/node_modules/carbon-react/lib/components/app-wrapper/app-wrapper.js
{:relative-to #object[java.io.File 0x6164b3a2 "/home/manuel/7bridges/code/carbon-example/node_modules/carbon-react/lib/components/app-wrapper/app-wrapper.js"], :entry "../../utils/helpers/tags"}
ExceptionInfo: failed to resolve: ../../utils/helpers/tags from /home/manuel/7bridges/code/carbon-example/node_modules/carbon-react/lib/components/app-wrapper/app-wrapper.js
thank you, but no worries, we are testing different JS/CSS toolkits, so it may be the only case.
I ended up doing this with sed:
- run: HASH=$(sed 's/.*:output-name \"main\.\([a-zA-Z0-9]*\)\.js\".*/\1/' public/js/manifest.edn)
- run: echo $HASH
- run: sed -n "s|\"/js\/main\.js\"|main.$HASH\.js\"|g" public/index.html
if anyone has a better idea