This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (2)
- # architecture (7)
- # aws (1)
- # babashka (105)
- # beginners (88)
- # braveandtrue (2)
- # calva (9)
- # cider (18)
- # cljs-dev (265)
- # cljsrn (22)
- # clojure (138)
- # clojure-argentina (3)
- # clojure-austin (1)
- # clojure-france (14)
- # clojure-italy (6)
- # clojure-uk (8)
- # clojurescript (283)
- # community-development (4)
- # conjure (11)
- # datomic (43)
- # docker (12)
- # duct (16)
- # emacs (1)
- # figwheel (1)
- # figwheel-main (27)
- # fulcro (10)
- # graalvm (6)
- # kaocha (4)
- # malli (9)
- # off-topic (13)
- # rdf (2)
- # reagent (12)
- # shadow-cljs (86)
- # spacemacs (1)
- # vrac (1)
@rberger your http2 problem also popped up in a stackoverflow question. it appears this is a bug in shadow-cljs. the aws package is using browser overrides in a way I thought weren't allowed but I guess they are. will look into fixing that soon.
I have a problem with shadow-cljs:
This error sometimes occurs when I attempt to load a function in cider, and I find it hard to reach the underlying problem.
repl/invoke error SyntaxError: Unexpected token '.' at eval (<anonymous>) at Object.shadow$cljs$devtools$client$browser$global_eval [as global_eval] (browser.cljs:184) at eval (browser.cljs:187) at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] (env.cljs:117) at Object.shadow$cljs$devtools$client$browser$repl_invoke [as repl_invoke] (browser.cljs:187) at shadow$cljs$devtools$client$browser$handle_message (browser.cljs:240) at eval (env.cljs:196) at Object.shadow$cljs$devtools$client$env$process_next_BANG_ [as process_next_BANG_] (env.cljs:184) at Object.shadow$cljs$devtools$client$env$process_ws_msg [as process_ws_msg] (env.cljs:197) at WebSocket.eval (browser.cljs:340) shadow$cljs$devtools$client$browser$repl_error @ browser.cljs:173 shadow$cljs$devtools$client$env$repl_call @ env.cljs:138 shadow$cljs$devtools$client$browser$repl_invoke @ browser.cljs:187 shadow$cljs$devtools$client$browser$handle_message @ browser.cljs:240 eval @ env.cljs:196 shadow$cljs$devtools$client$env$process_next_BANG_ @ env.cljs:184 shadow$cljs$devtools$client$env$process_ws_msg @ env.cljs:197 eval @ browser.cljs:340
Probably not helpful:
(deftest cart-show-on-click-test (db-refresh) (user/click-cart-btn) (is @sub/cart-shown?) )
network tab, filter WS, should be one. then click "messages", there should be multiple
I see the error message. How do I find the code generated when the function is evaluated?
I had showed you a truncated version of the deftest. The original deftest uses an undefined function. It would be better if shadow can make undefined-kind errors explicit.
using undefined things should generate warnings and fail with a different kind of error as well
I don't have enough information so if you want to share the actual code and the actual generated bad code I can take a look
That map contains a msg key whose value says:
How about the msg key's value were shown in the console directly?
Use of undeclared Var dom/img-id
cljs.user=> (+ 1 foo) ------ WARNING - :undeclared-var ----------------------------------------------- Resource: :1:6 Use of undeclared Var cljs.user/foo -------------------------------------------------------------------------------- ##NaN
Oh, I didn't know that the message shows in the repl. How about it were shown in the browser console too?
By the way, I have required the
dom namespace but using
dom/img-id gives that
dom is not defined.
Sorry, I meant I have this
(:require [vendo.workspaces.dom :as dom])
in this namespace gives:
dom is undefined
because if you do this at the REPL
(:require [vendo.workspaces.dom :as dom]) you are literally doing a keyword lookup of the vector
every time you ask something and post a small snippet of code and I never get the full picture
And the keybinding for switching the repl to the current buffer's namespace isn't working anymore.
Yes, after restarting, I could change the repl's namespace to the namespace where I'm using dom, but the error persists
hey @thheller - do you have a WIP branch somewhere with yesterday's CLJS release? wondering if it fixes a couple of inference warnings we've been seeing
the warning would pop up on first build, but on subsequent builds it wouldn't appear - not a shadow thing this, afaict
has anyone used jest with clojurescript? How did you install it? After I install it using npm install jest and add "test":"jest" in package.json, I expect keywords like "expect" to work:
But I get that expect is undefined. js/expect gives undefined as well. How to get jest to work with clojurescript?
(.toBeInTheDocument (expect (.getByText screen "Some Component")))
Random shadow-cljs background question: what does
ana stand for? That is the folder that stores all the Clojure dependencies.
Thanks for entertaining my curiosity 🙂
@pshar10 jest is not compatible. it expects to process and rewrite the JS files directly but doesn't understand the CLJS output format
@thheller how about this library? Its src is in typescript though. Do you think this can be used?
so the globals are here https://github.com/agilgur5/jest-without-globals/blob/master/src/index.ts