clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Trung Dinh 2020-10-08T08:30:40.325Z

Hi, not sure how to import material ui icons, I’ve tried both

["@material-ui/icons/InboxIcon" :refer [InboxIcon]]
and
["@material-ui/icons" :refer [InboxIcon]]
But none of them work, appreciate any help, cheers

p-himik 2020-10-08T08:50:14.325100Z

If you're using shadow-cljs, it should be ["@material-ui/icons/InboxIcon" :default InboxIcon].

Trung Dinh 2020-10-08T09:05:38.325300Z

thanks, yes I use shadow-cljs, strange I still got

[:app] Build failure:
The required JS dependency "@material-ui/icons/InboxIcon" is not available, it was required by "iam_frontend/core.cljs".
I already did “npm install @material-ui/icons”…

p-himik 2020-10-08T09:11:11.325500Z

Does your directory structure looks in any way similar?

Trung Dinh 2020-10-08T09:13:22.326200Z

yes it does

Trung Dinh 2020-10-08T09:13:37.326400Z

p-himik 2020-10-08T09:14:23.326800Z

Try stopping shadow-cljs, removing all build artifacts and the .shadow-cljs directory, and launching shadow-cljs again.

Trung Dinh 2020-10-08T09:16:29.327100Z

all good, it should be “@material-ui/icons/Inbox” instead of “InboxIcon”

Trung Dinh 2020-10-08T09:16:35.327300Z

many thanks again

p-himik 2020-10-08T09:16:43.327500Z

Ah, right. HPH