Fork me on GitHub
#shadow-cljs
<
2023-11-06
>
J13:11:15

Hi guys! I don’t know if it’s normal or not but this don’t include the css

(ns foo.core
  "some doctring?"
  {:shadow.css/include ["..."]})
but this works:
(ns foo.core
  {:shadow.css/include ["..."]})

thheller13:11:16

just do

(ns foo.core
  {:doc "some doctring?"
   :shadow.css/include ["..."]}
  )

thheller13:11:35

the parsing that collects these includes is very basic, could be that the string confuses it

josesanch17:11:21

Hello I'm facing an error that I don't know how to resolve. Sudenly, the project is failing to use react-select. I'm receiving this error js.js:90 TypeError: global is not a function at shadow$provide.module$node_modules$react_select$dist$index_d1cb43f3_cjs_dev (index-d1cb43f3.cjs.dev.js:930:82) at shadow.js.jsRequire (js.js:81:18) at shadow$provide.module$node_modules$react_select$dist$Select_d63eed7b_cjs_dev (Select-d63eed7b.cjs.dev.js:12:13) at shadow.js.jsRequire (js.js:81:18) at shadow$provide.module$node_modules$react_select$dist$react_select_cjs_dev (react-select.cjs.dev.js:9:14) at shadow.js.jsRequire (js.js:81:18) at shadow$provide.module$node_modules$react_select$dist$react_select_cjs (react-select.cjs.js:7:20) at shadow.js.jsRequire (js.js:81:18) at shadow.js.require (js.js:137:20) at eval (admin.dashboard.core.js:2:70) Admin core contains this: (ns admin.dashboard.core (:require [admin.layout.core :as alayout] ["react-select" :default Select] [o2w.routes :as routes] [ui.core :as ui] [re-svg-icons.feather-icons :as feather])) (defn btn [{:keys [route icon title]}] [:div.col-sm-4 [:a.btn.btn-outline-primary.text-center.p-3.d-block.mb-3 {:href (routes/url route)} [icon {:height "128px" :width "128px"}] [:p.pt-5 title]]]) (defn page [] [alayout/admin {:title "Dashboard"} [ui/card {:title "Dashboard"} [:div.row [:> Select {:value 1 :options [{:id "1" :name "hola"}]}] [btn {:title "Configurar tienda" :icon feather/tool :route :admin/config}] [btn {:title "Contenidos" :icon feather/list :route :admin/paginas}] [btn {:title "Cabeceras" :icon feather/film :route :admin/cabeceras}] [btn {:title "Banners" :icon feather/image :route :admin/banners}]]]]) Any ideas?

josesanch17:11:33

I'm using shadow-cljs 2.25.10 and react select 5.8.0. I tried everything I know to make it works without any luck

josesanch18:11:13

I've tested with a minimal enviroment an it works.

josesanch18:11:23

I don't know why is not working now in the project. If anybody has any suggestion to try would be so much helpful. Thank you!

josesanch18:11:24

It looks like has something to be with cache.

josesanch18:11:05

cleaning node_modules, yarn.lock and .shadow-cljs has solve the problem. Thank you again. And sorry for the interruption! Regards

thheller18:11:04

don't throw away your lock file in cases like this, its the only thing that makes it reproducible 😛

thheller18:11:26

but yes, by deleting the lock file you likely got some other versions of the npm packages that then happen to work

thheller18:11:45

global is otherwise a variable that exists in node but not in the browser

thheller18:11:21

something the react-select package apparently tried to use, so no clue about that

thheller18:11:44

btw use three backticks to

get
multi
line
code
highlighting