This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-23
Channels
- # babashka (4)
- # beginners (46)
- # biff (64)
- # calva (34)
- # cider (29)
- # cljdoc (12)
- # cljs-dev (16)
- # clojure (42)
- # clojure-australia (2)
- # clojure-china (1)
- # clojure-europe (35)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (4)
- # clojurescript (3)
- # core-typed (3)
- # cursive (5)
- # datalevin (3)
- # datomic (23)
- # hyperfiddle (92)
- # joyride (8)
- # juxt (3)
- # malli (1)
- # nbb (44)
- # pathom (10)
- # portal (3)
- # rdf (1)
- # reitit (10)
- # shadow-cljs (60)
- # sql (12)
Hi, has anyone had success using AWS SDK for JavaScript v3
in a ClojureScript webapp? Running into the following in steps 4+5 here: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-started-react-native.html#getting-started-react-write-native-code
npm install @aws-sdk/client-s3
(ns foo.bar
(:require
["@aws-sdk/client-s3" :as s3]))
As soon as I eval the ns form:
The required JS dependency "http2" is not available, it was required by "node_modules/@smithy/node-http-handler/dist-cjs/node-http2-handler.js".
Dependency Trace:
...
node_modules/@aws-sdk/client-s3/dist-cjs/index.js
node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js
node_modules/@smithy/smithy-client/dist-cjs/index.js
node_modules/@smithy/smithy-client/dist-cjs/collect-stream-body.js
node_modules/@smithy/util-stream/dist-cjs/index.js
node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js
node_modules/@smithy/node-http-handler/dist-cjs/index.js
node_modules/@smithy/node-http-handler/dist-cjs/node-http2-handler.js
you can use webpack for the JS deps via https://shadow-cljs.github.io/docs/UsersGuide.html#js-provider-external
thanks for the link @U05224H0W I’ll try that
I've made progress on the guava conflict in certain builds. In my case (every case?) it appears to be a conflict with tools.build. Thread
Summary of issue: java.lang.NoClassDefFoundError: com/google/common/collect/Streams
Relevant classpath trace:
So, the conflict is between
io.github.clojure/tools.build 0.9.5
. org.clojure/tools.deps 0.18.1354
. com.google.guava/guava 31.1-android :newer-version
and
thheller/shadow-cljs 2.25.2
X org.clojure/clojurescript 1.11.60 :use-top
. com.google.javascript/closure-compiler-unshaded v20230411
X com.google.guava/guava 31.0.1-jre :superseded
In the past, I have worked around by including com.google.guava/guava {:mvn/version "31.1-jre"}
in project deps
However, this also works, and seems to be the better fix: io.github.clojure/tools.build {:mvn/version "0.9.5" :exclusions [com.google.guava/guava #_ 31.1-android]}
Commenting here because I've read all the historical threads and don't recall anyone getting this far. Maybe I have made a mistake
but I have advised with solution many times in many threads as that is a rather frequent problem
For the record, the theller guidance is to shell out to shadow to limit classpath contaminataion
this one looks to me like a mistake in tools.build
I have also suggested pinning the specific version in your own deps or adding exclusions, but yes best option is to keep the classpath clean
I can't tell yet if clean classpath is a real solution because, due to clojurescript macroexpansion, shadow requires app classpath to build
what the fuck https://github.com/clojure/tools.deps/blob/master/deps.edn#L14
com.google.guava/guava {:mvn/version "31.1-android"} ;; update transitive dep due to CVE-2020-8908
https://nvd.nist.gov/vuln/detail/CVE-2020-8908
here is the original commit https://github.com/clojure/tools.deps/commit/4f848c920d4905d84263ab27c097ce623daa0aed
I wonder if its an acceptable fix to just have shadow-cljs depend on a newer guava version again 😛
that CVE is years old, the override can likely be removed, and it's unclear if the override was ever correct
it used to when the closure compiler didn't declare it correctly, but thats not really a fix as long as a android variant is arround
just checked https://mvnrepository.com/artifact/org.apache.maven/maven-core/3.9.4 and it still has a bunch of CVEs, not sure if they are the same though
afaict shadow depends on the correct guava version right now, shadow is doing the right thing
thheller/shadow-cljs 2.25.2
X org.clojure/clojurescript 1.11.60 :use-top
. com.google.javascript/closure-compiler-unshaded v20230411
X com.google.guava/guava 31.0.1-jre :superseded
copy paste error
Now I understand - yes, if shadow depends directly on an upgraded guava (to a backwards compat version that is newer) - it would take precedence
so might make sense for shadow-cljs to force a known compatible version that "defeats" the common known android variants
Hi shadow-cljs folks. Looking for some help building a release for my browser-targeting app. Running npm run release
works locally but not on my server. I have been able to reproduce this with https://github.com/minimal-xyz/minimal-shadow-cljs-browser. As shown below, it works on local but fails on server. Any thoughts to help me debug this? Thanks!
Local machine (macbook):
$ npm install
$ npm run release
[:app] Compiling ...
[:app] Build completed. (46 files, 1 compiled, 0 warnings, 12.35s)
$ tree target/
target/
├── index.html
├── main.js
└── manifest.edn
Server (ubuntu):
$ npm install
$ npm run release
[:app] Compiling ...
$ tree target/
target/
└── index.html
Yeah, that looks like it's the issue. /var/log/kern.log
is showing plenty of Out of memory: Killed process 6432 (java)
that is not a valid option in the build config itself, only at the shadow-cljs.edn root
Still failing due to OOM, using
{:source-paths ["src"]
:dependencies []
:dev-http {8080 "target/"}
:jvm-opts ["-Xmx256M"]
:builds {:app {:output-dir "target/"
:asset-path "."
:target :browser
:modules {:main {:init-fn app.main/main!}}}}}
I want this compile to happen as part of CI. I guess I could build on CI and then rsync the result to the server ...