Fork me on GitHub
#shadow-cljs
<
2023-01-17
>
simon13:01:31

Hi all, has anybody seen an error like that before?

RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
java.util.Optional.isEmpty()Z
....
Caused by:NoSuchMethodError: java.util.Optional.isEmpty()Z
 	com.google.javascript.jscomp.StaticSuperPropReplacer.tryReplaceSuper (StaticSuperPropReplacer.java:102)
My first guess is that it's due to an incompatible java version. I remember I had a problem with the java version before, that's why I stick with 2.19.6 of shadow-cljs. Unfortunately this happens during the build on netlify, and before trying to reproduce or look further into it, I wanted to check if it's a known error.

thheller15:01:47

hmm never seen that one before, but my guess is also java version

thheller15:01:50

needs to be java11+

simon19:01:23

Ok, thank you! I’ll try to move the build to github actions then

fabrao19:01:11

I don't know if I changed something in my project but , I could not see the source code of clojurescript in sources of browser

fabrao19:01:49

what parameter from compiler generate that?

:dev
   {:compiler-options
    {:output-feature-set :es2018
     :source-map         true
     :closure-defines    {goog.DEBUG true}}}

fabrao19:01:55

source-map?

thheller19:01:59

yes, source maps. but more likely if you messed with paths is that its now trying to load them from the incorrect path

thheller19:01:08

any errors/warnings in the browser console?

thheller19:01:35

you don't need any of the compiler options above. those are all the defaults and repeating them does nothing

wcalderipe21:01:49

I updated my CIDER version to 1.6.0, and since then, my REPL has stopped work with the following message:

WARNING: CIDER requires cider-nrepl to be fully functional. Some features will only be available with it! (More information)
I have cider-nrepl in my ~/.shadow-cljs/config.edn, and I can see it when I run $ yarn shadow-cljs classpath.
{:dependencies [[cider/cider-nrepl "0.29.0"]
                [refactor-nrepl "3.6.0"]
                [cider/piggieback "0.5.2"]]}
I've also tried downgrading CIDER from 1.6.0 to 1.5.0, 1.4.0, and 1.3.0, but none worked. Have anyone passed a similar situation?

thheller13:01:14

I don't use cider so I can't give you any specific answers. But how did you start the JVM? Maybe it wasn't started by the shadow-cljs command? nothing else will read ~/.shadow-cljs/config.edn, so it may just be started differently.

wcalderipe09:01:09

I'll narrow down the problem using shadow's quickstart template today and will come back with a solution. Thanks for the answer @U05224H0W

wcalderipe09:01:09

Just sharing a solution after narrowing down the issue this week. For some reason, the cider-connect-clj&cljs stopped working after I bumped CIDER's version. The Emacs weren't sending commands to the REPL anymore, probably because of the warning below.

WARNING: CIDER 1.6.0 requires cider-nrepl 0.29.0, but you're currently using cider-nrepl 0.25.3. The version mismatch might break some functionality! (More information)
The project I'm working on was using yarn shadow-cljs watch :webapp :api to start the watchers, and everything worked fine before the bump. But now I have to explicitly say to shadow-cljs to inject CIDER's dependencies (like done under the hood by cider-jack-in-clj&-cljs.
yarn shadow-cljs \
         -d nrepl/nrepl:1.0.0 \
         -d cider/cider-nrepl:0.29.0 \
         -d refactor-nrepl/refactor-nrepl:3.6.0 \
         -d cider/piggieback:0.5.2 \
         watch :webapp :api
I'm happy it's working now, but I wonder what changed to force me to run watch with the dependencies. I thought that if I defined those packages in my ~/.shadow-cljs/config.edn, shadow-cljs would inject them automatically.

thheller09:01:07

they should be injected, but as I said only the shadow-cljs command will read that config file. so if you are using project.clj or deps.edn they won't be injected. you never shared your project config, so don't know if you are doing that

wcalderipe09:01:00

We're using shadow-cljs.edn. Here's the project and environment configuration files if you want to take a look https://gist.github.com/wcalderipe/f2279335bbcb3a8ad63cdd13e397cd67

thheller09:01:05

that is fine. only other thing I can think of is the location of the config.edn file

thheller09:01:41

I added support for XDG_CONFIG_HOME, so if you have another shadow-cljs/config.edn file sitting there that is empty

👀 2
thheller09:01:49

then ~/.shadow-cljs/config.edn won't be used

thheller09:01:15

or LOCALAPPDATA in case your on windows

wcalderipe09:01:53

The config.edn is the only file in the direction. Also, the XDG_CONFIG_HOME variable is empty.

~/.shadow-cljs❯ pwd
/Users/wcalderipe/.shadow-cljs
~/.shadow-cljs❯ ls -la
total 8
drwxr-xr-x    3 wcalderipe  staff    96 May 10  2021 .
drwxr-xr-x+ 120 wcalderipe  staff  3840 Jan 21 10:48 ..
-rw-r--r--    1 wcalderipe  staff   131 Jan 19 19:03 config.edn
~/.shadow-cljs❯ echo $XDG_CONFIG_HOME
I can't find docs for XDG_CONFIG_HOME. Should I use it alongside the watch command like XDG_CONFIG_HOME=/another/config.edn yarn shadow-cljs watch :webapp?

thheller09:01:47

if its not set then ~/.shadow-cljs/config.edn should be the only file read

thheller09:01:56

you should not set it manually no

👍 2