My first try to include a javascript npm package failed. I want to use Bootstrap 5 (currently in beta) Download · Bootstrap v5.0
> npm install bootstrap@next
Works fine
(ns test
(:require ["bootstrap" :as bootstrap]))
Then I start shadow-cljs
> shadow-cljs watch app
but it errors
[:app] Configuring build.
[:app] Compiling ...
[:app] Build failure:
failed to convert sources
{:tag :shadow.build.closure/convert-error, :sources [[:shadow.build.npm/resource "node_modules/@popperjs/core/dist/cjs/popper.js"] [:shadow.build.npm/resource "node_modules/bootstrap/dist/js/bootstrap.js"]]}
ExceptionInfo: failed to convert sources
shadow.build.closure/convert-sources-simple*/fn--13753 (closure.clj:1968)
shadow.build.closure/convert-sources-simple* (closure.clj:1955)
shadow.build.closure/convert-sources-simple* (closure.clj:1833)
shadow.build.closure/convert-sources-simple (closure.clj:2127)
shadow.build.closure/convert-sources-simple (closure.clj:2079)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1169)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1162)
shadow.build.compiler/compile-all (compiler.clj:1414)
shadow.build.compiler/compile-all (compiler.clj:1281)
shadow.build.api/compile-sources (api.clj:257)
shadow.build.api/compile-sources (api.clj:249)
shadow.build/compile (build.clj:442)
shadow.build/compile (build.clj:432)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:363)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:344)
shadow.cljs.devtools.server.worker.impl/eval17161/fn--17163 (impl.clj:439)
clojure.lang.MultiFn.invoke (MultiFn.java:234)
shadow.cljs.devtools.server.util/server-thread/fn--16923/fn--16924/fn--16932 (util.clj:284)
shadow.cljs.devtools.server.util/server-thread/fn--16923/fn--16924 (util.clj:283)
shadow.cljs.devtools.server.util/server-thread/fn--16923 (util.clj:256)
java.lang.Thread.run (Thread.java:832)
Caused by:
RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
LET 372 [length: 36] [source_file: node_modules/bootstrap/dist/js/bootstrap.js]
Node(OBJECT_PATTERN): node_modules/bootstrap/dist/js/bootstrap.js:372:15
for (let {
Parent(DESTRUCTURING_LHS): node_modules/bootstrap/dist/js/bootstrap.js:372:15
for (let {
com.google.common.base.Preconditions.checkArgument (Preconditions.java:142)
com.google.javascript.jscomp.Es6RewriteDestructuring.replacePattern (Es6RewriteDestructuring.java:349)
com.google.javascript.jscomp.Es6RewriteDestructuring.visitPattern (Es6RewriteDestructuring.java:319)
com.google.javascript.jscomp.Es6RewriteDestructuring.visit (Es6RewriteDestructuring.java:196)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:914)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:885)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:885)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:885)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:885)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.handleScript (NodeTraversal.java:847)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:882)
com.google.javascript.jscomp.NodeTraversal.traverse (NodeTraversal.java:416)
com.google.javascript.jscomp.NodeTraversal.traverse (NodeTraversal.java:426)
com.google.javascript.jscomp.TranspilationPasses.processTranspile (TranspilationPasses.java:450)
com.google.javascript.jscomp.Es6RewriteDestructuring.process (Es6RewriteDestructuring.java:144)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:317)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:232)
com.google.javascript.jscomp.Compiler.check (Compiler.java:1030)
com.google.javascript.jscomp.Compiler.performChecksAndTranspilation (Compiler.java:828)
com.google.javascript.jscomp.Compiler.lambda$stage1Passes$0 (Compiler.java:760)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:127)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:816)
com.google.javascript.jscomp.Compiler.stage1Passes (Compiler.java:758)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:675)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:564)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.closure/convert-sources-simple*/fn--13753/fn--13754 (closure.clj:1958)
shadow.build.closure/convert-sources-simple*/fn--13753 (closure.clj:1956)
shadow.build.closure/convert-sources-simple* (closure.clj:1955)
shadow.build.closure/convert-sources-simple* (closure.clj:1833)
shadow.build.closure/convert-sources-simple (closure.clj:2127)
shadow.build.closure/convert-sources-simple (closure.clj:2079)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1169)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1162)
shadow.build.compiler/compile-all (compiler.clj:1414)
shadow.build.compiler/compile-all (compiler.clj:1281)
shadow.build.api/compile-sources (api.clj:257)
shadow.build.api/compile-sources (api.clj:249)
shadow.build/compile (build.clj:442)
shadow.build/compile (build.clj:432)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:363)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:344)
shadow.cljs.devtools.server.worker.impl/eval17161/fn--17163 (impl.clj:439)
Caused by:
IllegalArgumentException: LET 372 [length: 36] [source_file: node_modules/bootstrap/dist/js/bootstrap.js]
com.google.common.base.Preconditions.checkArgument (Preconditions.java:142)
com.google.javascript.jscomp.Es6RewriteDestructuring.replacePattern (Es6RewriteDestructuring.java:349)
com.google.javascript.jscomp.Es6RewriteDestructuring.visitPattern (Es6RewriteDestructuring.java:319)
com.google.javascript.jscomp.Es6RewriteDestructuring.visit (Es6RewriteDestructuring.java:196)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:914)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:885)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:885)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:885)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:907)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:885)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:910)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1042)
com.google.javascript.jscomp.NodeTraversal.handleScript (NodeTraversal.java:847)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:882)
com.google.javascript.jscomp.NodeTraversal.traverse (NodeTraversal.java:416)
com.google.javascript.jscomp.NodeTraversal.traverse (NodeTraversal.java:426)
com.google.javascript.jscomp.TranspilationPasses.processTranspile (TranspilationPasses.java:450)
com.google.javascript.jscomp.Es6RewriteDestructuring.process (Es6RewriteDestructuring.java:144)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:317)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:232)
com.google.javascript.jscomp.Compiler.check (Compiler.java:1030)
com.google.javascript.jscomp.Compiler.performChecksAndTranspilation (Compiler.java:828)
com.google.javascript.jscomp.Compiler.lambda$stage1Passes$0 (Compiler.java:760)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:127)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:816)
com.google.javascript.jscomp.Compiler.stage1Passes (Compiler.java:758)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:675)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:564)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.closure/convert-sources-simple*/fn--13753/fn--13754 (closure.clj:1958)
shadow.build.closure/convert-sources-simple*/fn--13753 (closure.clj:1956)
shadow.build.closure/convert-sources-simple* (closure.clj:1955)
shadow.build.closure/convert-sources-simple* (closure.clj:1833)
shadow.build.closure/convert-sources-simple (closure.clj:2127)
shadow.build.closure/convert-sources-simple (closure.clj:2079)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1169)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1162)
shadow.build.compiler/compile-all (compiler.clj:1414)
shadow.build.compiler/compile-all (compiler.clj:1281)
shadow.build.api/compile-sources (api.clj:257)
shadow.build.api/compile-sources (api.clj:249)
shadow.build/compile (build.clj:442)
shadow.build/compile (build.clj:432)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:363)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:344)
shadow.cljs.devtools.server.worker.impl/eval17161/fn--17163 (impl.clj:439)
```