Fork me on GitHub
#shadow-cljs
<
2020-10-22
>
ianchow04:10:32

Hi, would appreciate if anyone could try to use this npm module @tonejs/piano https://www.npmjs.com/package/@tonejs/piano using shadow-cljs to see if the error is just on my end. Trying to instantiate a Piano object using (Piano.) results in TypeError: Class constructor _o cannot be invoked without 'new' and I can't figure out how to debug it.

AJ Jaro11:10:27

When I execute a build for shadow-cljs, there are still some :infer-warnings that get displayed. The default for this type of warning is false and there is no change in behavior when I add the additional compiler-option to set that warning type to false. Why are there some :infer-warning types that still display during the build even though the option is turned off by default or explicitly?

------ WARNING #22 - :infer-warning --------------------------------------------
 File: /ui/components/team.cljs:78:77
--------------------------------------------------------------------------------
  75 |            [:input {:placeholder "Username"
  76 |                     :value       username
  78 |                     :on-change   #(rf/dispatch-sync [::changeusername (.-target.value %)])}]
-----------------------------------------------------------------------------------^
 Cannot infer target type in expression (. p1__110681# -target.value)

thheller12:10:32

@ajarosinski use (.. % -target -value) and the warning should go away?

AJ Jaro12:10:58

Thanks. I couldn’t get this interop to work but I got something similar to get the build behavior to change.

thheller12:10:49

surprised .-target.value even works at all

JAtkins18:10:20

Any idea how the wrong version of an npm dep would end up used by shadow? I just upgraded sweetalert2 from v9 to v10 in package.json, and I verified that project/node_modules/sweetalert2 contains the published code for v10. I cleared everything from the :output-dir and :asset-path. However, after a shadow restart and compile, I see the code for sweetalert2 v9 in the :output-dir again...

JAtkins18:10:47

Oh, and I did check, ~/node_modules doesn't have any cached version of sweetalert

thheller19:10:59

try deleting .shadow-cljs/builds. thats the cache maybe something is confused

AJ Jaro12:10:17

@thheller I’ve found this particular flow a challenge when upgrading dependencies as well. It seems like this is required whenever a dependency is changed. Do you know of a better way to ensure the shadow-cljs build is updated when upgrading dependencies other than deleting builds?

thheller13:10:56

I haven't deleted builds in years so I don't have a clue what you are doing that makes this necessary

thheller13:10:05

if you have a reproducible case please open an issue

thheller13:10:46

which shadow-cljs version is this?

AJ Jaro01:10:18

@thheller This is in 2.11.4. I’ll try to make a reproducible case so we can investigate further

JAtkins19:10:07

ah, missed that one

JAtkins19:10:04

@thheller many thanks, that worked.

Александр Стоянов23:10:48

Hello! How can i run backend in re-frame template?

thheller23:10:13

better ask in #re-frame. shadow-cljs only handles CLJS stuff.