This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-31
Channels
- # announcements (1)
- # beginners (171)
- # cider (51)
- # clj-kondo (40)
- # cljsrn (5)
- # clojure (68)
- # clojure-dev (42)
- # clojure-europe (2)
- # clojure-italy (20)
- # clojure-spec (2)
- # clojure-uk (141)
- # clojurescript (19)
- # community-development (4)
- # core-async (17)
- # core-logic (3)
- # cursive (11)
- # data-science (1)
- # datomic (7)
- # defnpodcast (2)
- # figwheel (9)
- # figwheel-main (2)
- # fulcro (15)
- # graphql (21)
- # jackdaw (3)
- # joker (11)
- # juxt (1)
- # luminus (12)
- # off-topic (2)
- # pathom (73)
- # pedestal (2)
- # re-frame (41)
- # reagent (14)
- # reitit (4)
- # shadow-cljs (39)
- # tools-deps (4)
@lilactown so, what worked was reverting the project.clj back to figwheel 0.5.18, clojurescript 1.10.520 and re-frame 0.10.6. Go figure.
still a lot of tooling rough edges, but at least cljs has that linux-like quality where once it’s in a working state and as long as I don’t bump anything, it’ll probably keep working longer than my expected years remaining.
have a code-as-data question for cljs … if I’ve got a hold of the fn defined by (fn [_ _] [(subscribe [:a-thing]) (subscribe [:another-thing])])
, is there a clever way to get at that as a data structure after eval? I’m not above some sort of re-binding of subscribe
since really all I want is to go from that defined fn to [:a-thing :another-thing]
I thought binding
might work but it’s clear I don’t really understand how it works in cljs, and I also tried defining something like (defn fn' [& stuff] ,,, )
and wrapping real fn
so that I could maybe just take the code and hive it away in metadata.
(the task at hand: I’m trying a quick-and-dirty graphviz generator for re-frame subscriptions by wrapping reg-sub
).
hm, maybe I just re-define subscribe
temporarily so that when the fn is called (which is easy to do, since I have a hold of it) it spits out its arg.
Hey guys, I have this if block in my function
(if
(includes? error-msg "Validate Errors")
(map
#(vector :p %)
(-> error-msg
(replace #"above" "below")
(subs 1)
(split newline-regex)))
error-msg))))
Basically, it is meant to check if validate errors
is part of the error message and execute the functions on the macros
The code works fine excepts for the tests that fail with this error #object[TypeError TypeError: undefined is not a constructor (evaluating 'str.indexOf(subString)')]
The test is as follows :
(testing " Validate error message are displayed correctly"
(let [component (form-upload-component project-owner
:state
{:error-msg
"b Validate Errors"})
html-text (dommy/html component)]
(is (re-find #"Validate Errors" html-text))))
Can anyone help me figure out where the problem is?@mwatelaraycee33 try posting with with 3 backticks instead of line by line
looks better that way
as for your problem do you have the rest of the stacktrace? kinda hard to guess from just a tiny code snippet
ERROR in (xlsform-upload-state-tests) (contains@file:91362:21)
Uncaught exception, not in assertion.
expected: nil
actual: #object[TypeError TypeError: undefined is not a constructor (evaluating 'str.indexOf(subString)')]
maybe trying running the code outside of deftest
so the full exception is available and not only that useless truncated part
no it does not. problem is in metro and there is very little we can do. see https://github.com/facebook/metro/issues/104