Fork me on GitHub

Hello (not sure if this is the proper place to post this so apologies if that's not the case). I added a NPM package and I'm getting the following Closure Compiler error:

Closure compilation failed with 1 errors
--- node_modules/jspdf/dist/
Duplicate let / const / class / function declaration in the same scope is not allowed.
I assume this is an issue with the library code itself (as the error states). I'm just wondering if there's a "quick and dirty" fix to solve this, or if my only option is to fork and fix the dependency? The dependency:


no easy fix unfortunately. well besides using another "dist" they ship. maybe the commonjs version doesn't have that issue? assuming of course that they ship multiple versions

👍 3

I'm getting this error after connecting my editor to my REPL:

e iced repl :main --force-shadow-cljs --with-cljs -A:dev
OK: CLJS option is enabled.
OK: shadow-cljs project is detected
OK: For shadow-cljs project, start watching instead of starting REPL.
shadow-cljs - config: /project/shadow-cljs.edn  cli version: 2.8.64  node: v12.18.0
shadow-cljs - starting via "clojure"
shadow-cljs - HTTP server available at 
shadow-cljs - server version: 2.11.23 running at 
shadow-cljs - nREPL server started on port 9000
shadow-cljs - watching build :main
[:main] Configuring build.
[:main] Compiling ...
Mode: :runtime  Async? false  Throw? false
Guardrails was enabled because the CLJS Compiler config enabled it
[:main] Build completed. (287 files, 0 compiled, 0 warnings, 9.00s)
[2021-07-20 11:27:28.995 - WARNING] :shadow.cljs.devtools.server.nrepl-impl/init-ns-ex - {:init-ns sheluchin.user}
Note: The following stack trace applies to the reader or compiler, your code was not executed.
CompilerException Unexpected error macroexpanding defrecord at (rewrite_clj/node/comment.clj:6:1). #:clojure.error{:phase :macroexpansion, :line 6, :column 1, :source "rewrite_clj/node/comment.clj", :symbol defrecord}
    clojure.lang.Compiler.macroexpand1 (
    clojure.lang.Compiler.macroexpand (
    clojure.lang.Compiler.eval (
    clojure.lang.Compiler.load (
    clojure.lang.RT.loadResourceScript (
    clojure.lang.RT.loadResourceScript (
    clojure.lang.RT.load (
    clojure.lang.RT.load (
    clojure.core/load/fn--6839 (core.clj:6126)
    clojure.core/load (core.clj:6125)
    clojure.core/load (core.clj:6109)
    clojure.core/load-one (core.clj:5908)
Caused by:
    clojure.lang.Compiler.maybeResolveIn (
    clojure.core/ns-resolve (core.clj:4370)
    clojure.core/ns-resolve (core.clj:4359)
    clojure.core/resolve (core.clj:4372)
    clojure.core/resolve (core.clj:4372)
    clojure.core/map/fn--5866 (core.clj:2753)
    clojure.lang.LazySeq.sval (
    clojure.lang.LazySeq.seq (
    clojure.lang.RT.seq (
    clojure.core/seq--5402 (core.clj:137)
    clojure.core/reduce1 (core.clj:930)
    clojure.core/set (core.clj:4113)
There is some suggestion that the issue is coming up because I'm including CLJ function calls in CLJS and shadow doesn't know what to do with it:;cid=C68M60S4F Any suggestions for a fix? I can't seem to get around this one.


shadow-cljs is nowhere on that stacktrace. no clue what your REPL is doing


its not part of shadow-cljs compilation. that completed. so your REPL is trying to do something but I can't tell what

👍 4

I'm having hard time connecting to cljs REPL, I do this:

(require '[shadow.cljs.devtools.server :as server])
(require '[shadow.cljs.devtools.api :as shadow])
(shadow/watch :app)
(shadow/nrepl-select :app)
and everything but the last step works fine. The last step fails with :missing-nrepl-middleware. Where should I dig?


the nrepl server you connected do is missing the middleware


Oh, that's what I missed. Thank you Thomas!