Fork me on GitHub
#shadow-cljs
<
2023-01-24
>
rafaeldelboni14:01:51

Hey hello, I'm trying to use a wasm compiled lib called https://github.com/jedisct1/libsodium.js and when compiling with shadow-cljs I'm getting this error in the thread. Here is the sample repo for reproduction: https://github.com/rafaeldelboni/libsodium-playground/ Does anybody has experience integrating with this lib?

rafaeldelboni14:01:18

Interesting bits:

ExceptionInfo: failed to convert sources
...
Caused by:
RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
...
Caused by:
StackOverflowError: 
	com.google.javascript.jscomp.DeadAssignmentsElimination.tryRemoveAssignment (DeadAssignmentsElimination.java:219)

thheller14:01:54

try upgrading shadow-cljs, which also gives you a more current closure-compiler version

thheller14:01:17

that could be enough

rafaeldelboni14:01:55

I'm using "shadow-cljs": "2.20.20"

thheller14:01:56

ok, the task from above was 2.19.1

rafaeldelboni14:01:31

Yeah sorry I though updating shadow in a commit after I posted here.

thheller14:01:54

hmm I'm guessing it's related to the stack size again

thheller14:01:15

try :jvm-opts ["-Xss16m"] in shadow-cljs.edn

thheller14:01:19

or maybe more

rafaeldelboni14:01:42

woah that did the trick in my machine

rafaeldelboni14:01:48

gonna commit to check in CI

rafaeldelboni15:01:18

Yeap is working now, thanks I would never thing about the stack size.

thheller15:01:20

its a weird and very rare error

thheller15:01:57

was just a guess after running the libsodium.js file through the closure-compiler directly and that working 😛

🙇 2
Rodrigo Mantica14:01:40

Hello channel, I have a :node-test build which I run with shadow-cljs release. Sometimes I get an exit code 1 if an error occurs within the test source. However, when an async test times out or does not pass an assertion, the process exits gracefully. I would like to have a failure in these instances in order to stop my deployment process in CI. Any advice on how to achieve this?

thheller15:01:23

do you properly handle async tests? easy to mess up async tests, so hard to give specific advice

Rodrigo Mantica15:01:19

@U05224H0W I’m using react testing library which sometimes fails to find a dom node and thus times out. Not sure how to properly handle this situation with clojure test library :man-shrugging:

thheller15:01:45

not sure what you mean. do you call the async done callback when this timeout occurs?

Rodrigo Mantica15:01:08

Well I wouldn’t want to do that. I want the process to exit with a failure in that scenario

Rodrigo Mantica15:01:22

I’ll need to look into this a little closer and come back with more testing

thheller17:01:48

I'd need to see some code to give any more specifics

ingesol21:01:34

Hi! I have a build :app with :target :browser. It has an alternate module directory called lib in addition to node_modules , configured like

:js-package-dirs ["node_modules"
                   "lib"]
Now I added a new build with :target :npm-module. I added the same js-package-dirs config there. This build will not compile because it cannot find the modules inside lib. Is this supposed to work with npm-module target?

thheller21:01:24

what does "will not compile" mean? npm-module normally doesn't bundle JS dependencies so it shouldn't even matter

ingesol21:01:59

Huh, sorry I think I may be barking up the wrong tree here. This is part of a Storybook setup, and the error message I’m seeing could be from some of the JS build parts. They obviously don’t know about my lib folder. I picked up some advice you gave elsewhere about just npm install the modules I need from my lib folder, that actually worked.

hifumi12321:01:06

how do I set up SSL with dev-http? I'm trying a map like

:dev-http
{8080 {:host ""
       :ssl-port 8081}}
but it's not working. I'm using shadow-cljs' default SSL config, and the shadow-cljs server listening on port 9630 is using HTTPS. So I know it's not an SSL error

thheller21:01:55

that config is missing a :root, and with :ssl properly configured just :dev-http {8080 "public"} should use ssl

hifumi12322:01:29

Thanks! That fixed my problems