Fork me on GitHub
#shadow-cljs
<
2023-01-03
>
Crispin03:01:31

I am using an npm module that has another npm dependency (Im not requiring this second one directly myself). In this transitory dep, the main entry in the package.json of this module does not properly export the names, but the module entry does. I would like to use this referred file in the build, but I'm wary of converting the entire build to :entry-keys ["module" "browser" "main"]. Is there a way to overide the entry key for one particular module? What is the best approach in a situation like this? Can I tell shadow somehow to use this specific entry point for that package?

thheller06:01:32

did you try building with module first? I mean if it works then that is the best path

Crispin06:01:55

yes it works with module first

Crispin06:01:35

in an ideal world, would module be first (and it's just not first by default because of legacy npm modules?)

Crispin06:01:35

> otherwise you can use https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve Ah fantastic. I hoped there would be some kind of hook like this.

Ted Ciafardini15:01:26

$ shadow-cljs watch app

com/google/javascript/jscomp/CompilerOptions has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Getting this error when following the quickstart for shadow-cljs projects. $ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)
The shadow-cljs docs specify version 8 of java, I believe

thheller15:01:44

it used to be java8 but is java11 these days

thheller15:01:15

technically shadow-cljs would still be fine with java8, but the closure compiler started requiring java11 so we inherit that.

thheller15:01:28

but I'd recommend upgrading to the latest java LTS release (17) directly

Ted Ciafardini15:01:25

Thanks for the quick response

orestis15:01:49

Every now and then, I encounter this error in our CLJS CI tests (in github actions):

File: /home/runner/work/nosco-gamma/nosco-gamma/cljs/nosco/ui/animations.cljs
invalid cljs source type
{:resource-id [:shadow.build.classpath/resource "nosco/ui/animations.cljs"], :resource-name "nosco/ui/animations.cljs", :source #object["[B" 0x27e3b83f "[B@27e3b83f"]}
It is always with this file, and it is intermittent (a re-run will proceed normally). Is there anywhere I could look to stop it?

thheller16:01:40

weird. not sure how it would get a byte array there. :source is supposed to be a string

thheller16:01:53

its all slurp or restored from transit json cache. so dunno how you make it return a byte array instead

thheller16:01:20

do you have a user.clj that modifies some stuff in weird ways? or other code that modifies something related to slurp or transit?

orestis18:01:04

Hm, this is on CI, perhaps some weird caching issue might be in play.

orestis18:01:34

Thanks on the slurp/transit pointers, I will have a look.