This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-02
Channels
- # adventofcode (153)
- # announcements (29)
- # architecture (6)
- # babashka (5)
- # beginners (197)
- # calva (71)
- # clj-kondo (27)
- # cljfx (4)
- # cljs-dev (33)
- # cljsrn (1)
- # clojure (52)
- # clojure-australia (5)
- # clojure-boston (1)
- # clojure-europe (38)
- # clojure-france (1)
- # clojure-hungary (5)
- # clojure-italy (1)
- # clojure-nl (19)
- # clojure-uk (5)
- # clojurescript (12)
- # conjure (4)
- # core-async (3)
- # cursive (22)
- # datalog (70)
- # datomic (32)
- # deps-new (8)
- # emacs (79)
- # events (2)
- # fulcro (15)
- # graalvm (15)
- # leiningen (2)
- # lsp (5)
- # minecraft (1)
- # nbb (1)
- # off-topic (37)
- # polylith (11)
- # re-frame (9)
- # reagent (1)
- # reitit (3)
- # releases (1)
- # reveal (2)
- # shadow-cljs (42)
- # spacemacs (1)
- # tools-build (4)
- # tools-deps (55)
- # vim (11)
- # xtdb (6)
i'm able to eval expressions in one file but not another in the same project. my emacs buffers says its connected in one but not the other. I can't imagine how this could be.
What editor do you use if i might ask?
Maybe I'm misunderstanding something, but here goes. I have :paths ["src/main" "resources"]
in deps.edn
and :dev-http {8000 "classpath:public"}
in shadow-cljs.edn
. The dev server serves index.html
correctly from resources/public
when requested from localhost:8000
, but any other URL results in 404
. From the https://shadow-cljs.github.io/docs/UsersGuide.html#dev-http, I would expect that resources/public/index.html
is served, rather than resulting in 404
, correct?
If I change to :dev-http {8000 "resources/public"}
it works as expected. Wondering if its caused by something in shadow.http.push-state/handle
.
Ok, working today and suddenly I'm getting errors about a node package not being available, even though it was there the a second ago. I restarted the computer (it helped yesterday) and to no avail today. Error message is :
pnx-web.js:1455 Module not provided: module$node_modules$primereact$menu$menu_cjs
Updated all packages that had updates (re-frame-10x and shadow-cljs) .. compiler runs fine, imports are present.
If I look at the included js in chrome, I can navigate through node modules to get to the offending module and it does appear to be there.
shadow$provide["module$node_modules$primereact$menu$menu_cjs"] = function(global,require,module,exports) ...
Could it be something with ES vs CommonJs imports? Maybe you have updated a dependency with breaking changes?
Thats a good question. I'm using a great many prime react modules and the rest seem to work. The update I did that seemed to trigger this was updating IntelliJ, tho I can't clearly see what that would have impacted.
When I first did that (yesterday), the Button module wasn't working, but a reboot got everything going again and button has not been cranky since
SHADOW_ENV.evalLoad("module$node_modules$primereact$menu$menu_cjs.js", true, "shadow$provide.module$node_modules$Primereact$menu$menu_cjs\x3dfunction(global,require,module,exports) ...
There's def. no reference to PrimereactMenu in the requires anymore (there was 1) .. I nuked it from orbit, but it seems like something somewhere has cached it? The rest of the modules are lowercase as they should be.
I guess you've already tried it, but if you haven't already: a rm -rf node_modules
and an npm install
usually does the trick 😄
I've tried so many things to get my project building in last 3 hours that I cant remember what I did when 😄
Another trick is to go back in git history step by step until things start working again 😄
So the compile process is generating references to Primereact still.. if I go into the compiled files and edit them all back to lowercase my project is back
There is one that pops back into the compiled file every time, not sure where its getting it from
@U05224H0W any clues? I'm stumped at how to fix this. I checked the js module itself for references to Primereact instead or primereact and it does not appear to be causing the capital P to recur.
I don't really know what you are doing but usually errors such as this are user errors
ie. did you modify your :modules
config but did not adjust actually loading those modules in your HTML?
did you maybe change your :output-dir
and just continue loading a mix of old and new files?
I definitely had an errant require statement with a capital P, which I then eliminated but builds after kept going back to it regardless of npm ci / rebuild npm etc.
How do you require and use primereact things, @rdonahue? I tried to use the splitter and doing
(:require ["primereact/splitter" :as splitter])
results in splitter
evaluating to:
{"Splitter" #js
{"$$typeof" #object [Symbol (react.memo)],
:compare nil,
:type #js {"$$typeof" #object [Symbol (react.forward_ref)], :render #object [Function]}},
"SplitterPanel" #object [require]}
which I couldn’t figure out how to make reagent render… At some point I even had:
{"Splitter"
#js
{"$$typeof" #object [Symbol (react.memo)],
:compare nil,
:reagent-compiler2 #js
{"$$typeof" #object [Symbol (react.memo)],
:compare #object [reagent$impl$component$functional_render_memo_fn],
:type #object [Function]},
:type #js {"$$typeof" #object [Symbol (react.forward_ref)], :render #object [Function]}},
"SplitterPanel" #object [require]}
Which is extra weird to me, with the :reagent-compiler2
thing there…[:> splitter/Splitter {}
[:> splitter/SplitterPanel {} "panel 1"]
[:> splitter/SplitterPanel {} "panel 2"]]
this works for me
But in my code I have (:require ["primereact/splitter" :refer [Splitter SplitterPanel])
and I use the objects directlythe "$$typeof"
property is a hint that this is a react element, a memoized element in this case
so yeah, you just render it as @U02F0C62TC1 said
I’ve tried doing it the @U02F0C62TC1 way. Will give it another go now that I know it should work.
Well, now tried again and it just worked. Don’t know what I was trying yesterday… Thanks, and sorry for the noice and for resurrecting a pretty unrelated thread!
How do you require and use primereact things, @rdonahue? I tried to use the splitter and doing
(:require ["primereact/splitter" :as splitter])
results in splitter
evaluating to:
{"Splitter" #js
{"$$typeof" #object [Symbol (react.memo)],
:compare nil,
:type #js {"$$typeof" #object [Symbol (react.forward_ref)], :render #object [Function]}},
"SplitterPanel" #object [require]}
which I couldn’t figure out how to make reagent render… At some point I even had:
{"Splitter"
#js
{"$$typeof" #object [Symbol (react.memo)],
:compare nil,
:reagent-compiler2 #js
{"$$typeof" #object [Symbol (react.memo)],
:compare #object [reagent$impl$component$functional_render_memo_fn],
:type #object [Function]},
:type #js {"$$typeof" #object [Symbol (react.forward_ref)], :render #object [Function]}},
"SplitterPanel" #object [require]}
Which is extra weird to me, with the :reagent-compiler2
thing there…