This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-12
Channels
- # announcements (7)
- # babashka (13)
- # beginners (14)
- # business (7)
- # clerk (4)
- # clj-kondo (21)
- # clojure (42)
- # clojure-denmark (5)
- # clojure-dev (16)
- # clojure-europe (27)
- # clojure-finland (1)
- # clojure-nl (1)
- # clojure-norway (36)
- # clojure-sweden (2)
- # clojure-uk (34)
- # clojurescript (29)
- # datomic (15)
- # emacs (1)
- # hyperfiddle (13)
- # jobs (11)
- # joyride (8)
- # malli (15)
- # missionary (10)
- # off-topic (5)
- # portal (6)
- # releases (3)
- # shadow-cljs (9)
- # spacemacs (28)
- # specter (2)
- # squint (12)
Hello everyone,
I'm currently facing an issue with shadow-cljs
and the bwip-js
library in my ClojureScript project. The project works fine when I use shadow-cljs watch
, but I encounter a problem when I try to compile for production with shadow-cljs release
.
The error message I receive is:
(:require
[reagent.core :as r]
[reagent.dom.server :as rds]
["bwip-js" :as bwipjs]))
ExceptionInfo: package bwip-js had exports, but could not resolve ./dist/bwip-js-min.js
And this is the problematic code:
clojure.main/main (main.clj:616)
clojure.lang.Var.applyTo (Var.java:705)
clojure.main.main (main.java:40)
Caused by:
RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
null
Node(BLOCK): node_modules/bwip-js/dist/bwip-js.js:6352:30
$_.drawlayer = function() {
Parent(FUNCTION ): node_modules/bwip-js/dist/bwip-js.js:6352:19
$_.drawlayer = function() {
com.google.javascript.jscomp.Compiler.throwInternalError (Compiler.java:3233)
com.google.javascript.jscomp.NodeTraversal.throwUnexpectedException (NodeTraversal.java:509)
com.google.javascript.jscomp.NodeTraversal.traverseRoots (NodeTraversal.java:553)```
I’ve tried various solutions including changing the
:output-feature-set
to :es5
and :es6
, verifying the bwip-js
path, reinstalling the bwip-js
package, and using different versions of bwip-js
. However, none of these have resolved the issue.
Does anyone have any suggestions or has anyone encountered a similar issue before? Any help would be greatly appreciated.
Thank you!you really only make things harder by setting :output-feature-set
this low. it means it has much more processing to do, which means more opportunities for problems. really if anything you should be cranking it way up to something like :es-next
[:app] Compiling ...
failed to convert sources
{:tag :shadow.build.closure/convert-error, :sources [[:shadow.build.npm/resource "node_modules/object-assign/index.js"] [:shadow.build.npm/resource "node_modules/react/cjs/react.production.min.js"] [:shadow.build.npm/resource "node_modules/react/cjs/react.development.js"] [:shadow.build.npm/resource "node_modules/react/index.js"]
..... more node modules ....
[:shadow.build.npm/resource "node_modules/bwip-js/dist/bwip-js.js"]]}
ExceptionInfo: failed to convert sources
shadow.build.closure/convert-sources-simple*/fn--13149 (closure.clj:2093)
shadow.build.closure/convert-sources-simple* (closure.clj:2080)
shadow.build.closure/convert-sources-simple* (closure.clj:1944)
shadow.build.closure/convert-sources-simple (closure.clj:2254)
shadow.build.closure/convert-sources-simple (closure.clj:2204)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1247)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1240)
shadow.build.compiler/compile-all (compiler.clj:1496)
shadow.build.compiler/compile-all (compiler.clj:1359)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.api/release* (api.clj:338)
shadow.cljs.devtools.api/release* (api.clj:324)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:28)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:25)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:49)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:38)
shadow.cljs.devtools.cli-actual/main/body-fn--16536--auto----17201 (cli_actual.clj:166)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:165)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)
clojure.core/apply (core.clj:671)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:667)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli/-main (cli.clj:75)
shadow.cljs.devtools.cli/-main (cli.clj:67)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:667)
clojure.main/main-opt (main.clj:514)
clojure.main/main-opt (main.clj:510)
clojure.main/main (main.clj:664)
clojure.main/main (main.clj:616)
clojure.lang.Var.applyTo (Var.java:705)
clojure.main.main (main.java:40)
Caused by:
RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
null
Node(BLOCK): node_modules/bwip-js/dist/bwip-js.js:6352:30
$_.drawlayer = function() {
Parent(FUNCTION ): node_modules/bwip-js/dist/bwip-js.js:6352:19
$_.drawlayer = function() {
com.google.javascript.jscomp.Compiler.throwInternalError (Compiler.java:3233)
com.google.javascript.jscomp.NodeTraversal.throwUnexpectedException (NodeTraversal.java:509)
com.google.javascript.jscomp.NodeTraversal.traverseRoots (NodeTraversal.java:553)
com.google.javascript.jscomp.NodeTraversal$Builder.traverseRoots (NodeTraversal.java:473)
com.google.javascript.jscomp.FlowSensitiveInlineVariables.process (FlowSensitiveInlineVariables.java:277)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:240)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:179)
com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations (Compiler.java:2933)
com.google.javascript.jscomp.Compiler.lambda$stage2Passes$6 (Compiler.java:996)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:126)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:1044)
com.google.javascript.jscomp.Compiler.stage2Passes (Compiler.java:993)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:876)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:566)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.closure/convert-sources-simple*/fn--13149/fn--13150 (closure.clj:2083)
shadow.build.closure/convert-sources-simple*/fn--13149 (closure.clj:2081)
shadow.build.closure/convert-sources-simple* (closure.clj:2080)
shadow.build.closure/convert-sources-simple* (closure.clj:1944)
shadow.build.closure/convert-sources-simple (closure.clj:2254)
shadow.build.closure/convert-sources-simple (closure.clj:2204)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1247)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1240)
shadow.build.compiler/compile-all (compiler.clj:1496)
shadow.build.compiler/compile-all (compiler.clj:1359)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.api/release* (api.clj:338)
shadow.cljs.devtools.api/release* (api.clj:324)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:28)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:25)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:49)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:38)
shadow.cljs.devtools.cli-actual/main/body-fn--16536--auto----17201 (cli_actual.clj:166)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:165)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)
clojure.core/apply (core.clj:671)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:667)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli/-main (cli.clj:75)
shadow.cljs.devtools.cli/-main (cli.clj:67)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:667)
clojure.main/main-opt (main.clj:514)
clojure.main/main-opt (main.clj:510)
clojure.main/main (main.clj:664)
clojure.main/main (main.clj:616)
clojure.lang.Var.applyTo (Var.java:705)
clojure.main.main (main.java:40)
Caused by:
NullPointerException:
com.google.javascript.rhino.HamtPMap.equivalent (HamtPMap.java:412)
com.google.javascript.jscomp.MaybeReachingVariableUse$ReachingUses.equalMaps (MaybeReachingVariableUse.java:164)
com.google.javascript.rhino.HamtPMap.equivalent (HamtPMap.java:439)
com.google.javascript.rhino.HamtPMap.equivalent (HamtPMap.java:411)
com.google.javascript.jscomp.MaybeReachingVariableUse$ReachingUses.equals (MaybeReachingVariableUse.java:160)
com.google.javascript.jscomp.DataFlowAnalysis.flow (DataFlowAnalysis.java:304)
com.google.javascript.jscomp.DataFlowAnalysis.analyze (DataFlowAnalysis.java:225)
com.google.javascript.jscomp.FlowSensitiveInlineVariables.enterScope (FlowSensitiveInlineVariables.java:206)
com.google.javascript.jscomp.NodeTraversal.pushScope (NodeTraversal.java:1150)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:936)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:1008)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:905)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:1008)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:905)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:1008)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:905)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:1008)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:905)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1131)
com.google.javascript.jscomp.NodeTraversal.handleScript (NodeTraversal.java:847)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:902)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseRoots (NodeTraversal.java:549)
com.google.javascript.jscomp.NodeTraversal$Builder.traverseRoots (NodeTraversal.java:473)
com.google.javascript.jscomp.FlowSensitiveInlineVariables.process (FlowSensitiveInlineVariables.java:277)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:240)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:179)
com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations (Compiler.java:2933)
com.google.javascript.jscomp.Compiler.lambda$stage2Passes$6 (Compiler.java:996)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:126)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:1044)
com.google.javascript.jscomp.Compiler.stage2Passes (Compiler.java:993)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:876)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:566)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.closure/convert-sources-simple*/fn--13149/fn--13150 (closure.clj:2083)
shadow.build.closure/convert-sources-simple*/fn--13149 (closure.clj:2081)
shadow.build.closure/convert-sources-simple* (closure.clj:2080)
shadow.build.closure/convert-sources-simple* (closure.clj:1944)
shadow.build.closure/convert-sources-simple (closure.clj:2254)
shadow.build.closure/convert-sources-simple (closure.clj:2204)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1247)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1240)
shadow.build.compiler/compile-all (compiler.clj:1496)
shadow.build.compiler/compile-all (compiler.clj:1359)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.api/release* (api.clj:338)
shadow.cljs.devtools.api/release* (api.clj:324)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:28)
The version of bwip-js :
"version": "4.2.0",
"shadow-cljs": "^2.27.3"
Now not working with watch app
i don't know happened
npx shadow-cljs watch app
[:app] Compiling ...
[:app] Build failure:
failed to convert sources
{:tag :shadow.build.closure/convert-error, :sources [[:shadow.build.npm/resource "node_modules/object-assign/index.js"]
..... more node modules ......
[:shadow.build.npm/resource "node_modules/plotly_DOT_js/dist/plotly.js"] [:shadow.build.npm/resource "node_modules/react-plotly_DOT_js/react-plotly.js"] [:shadow.build.npm/resource "node_modules/react-pivottable/PlotlyRenderers.js"] [:shadow.build.npm/resource "node_modules/bwip-js/dist/bwip-js.js"]]}
ExceptionInfo: failed to convert sources
shadow.build.closure/convert-sources-simple*/fn--13152 (closure.clj:2072)
shadow.build.closure/convert-sources-simple* (closure.clj:2059)
shadow.build.closure/convert-sources-simple* (closure.clj:1923)
shadow.build.closure/convert-sources-simple (closure.clj:2233)
shadow.build.closure/convert-sources-simple (closure.clj:2183)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1385)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1378)
shadow.build.compiler/compile-all (compiler.clj:1634)
shadow.build.compiler/compile-all (compiler.clj:1497)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:368)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:349)
shadow.cljs.devtools.server.worker.impl/do-resource-update (impl.clj:540)
shadow.cljs.devtools.server.worker.impl/do-resource-update (impl.clj:495)
shadow.cljs.devtools.server.util/server-thread/fn--15399/fn--15400/fn--15408 (util.clj:283)
shadow.cljs.devtools.server.util/server-thread/fn--15399/fn--15400 (util.clj:282)
shadow.cljs.devtools.server.util/server-thread/fn--15399 (util.clj:255)
java.lang.Thread.run (Thread.java:829)
Caused by:
RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
null
Node(BLOCK): node_modules/bwip-js/dist/bwip-js.js:19468:25
$_.encb = function() {
Parent(FUNCTION ): node_modules/bwip-js/dist/bwip-js.js:19468:14
$_.encb = function() {
com.google.javascript.jscomp.Compiler.throwInternalError (Compiler.java:3269)
com.google.javascript.jscomp.NodeTraversal.throwUnexpectedException (NodeTraversal.java:509)
com.google.javascript.jscomp.NodeTraversal.traverseRoots (NodeTraversal.java:553)
com.google.javascript.jscomp.NodeTraversal$Builder.traverseRoots (NodeTraversal.java:473)
com.google.javascript.jscomp.FlowSensitiveInlineVariables.process (FlowSensitiveInlineVariables.java:277)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:240)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:179)
com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations (Compiler.java:2969)
com.google.javascript.jscomp.Compiler.lambda$stage2Passes$7 (Compiler.java:1031)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:126)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:1079)
com.google.javascript.jscomp.Compiler.stage2Passes (Compiler.java:1028)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:914)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:566)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.closure/convert-sources-simple*/fn--13152/fn--13153 (closure.clj:2062)
shadow.build.closure/convert-sources-simple*/fn--13152 (closure.clj:2060)
shadow.build.closure/convert-sources-simple* (closure.clj:2059)
shadow.build.closure/convert-sources-simple* (closure.clj:1923)
shadow.build.closure/convert-sources-simple (closure.clj:2233)
shadow.build.closure/convert-sources-simple (closure.clj:2183)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1385)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1378)
shadow.build.compiler/compile-all (compiler.clj:1634)
shadow.build.compiler/compile-all (compiler.clj:1497)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:368)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:349)
shadow.cljs.devtools.server.worker.impl/do-resource-update (impl.clj:540)
shadow.cljs.devtools.server.worker.impl/do-resource-update (impl.clj:495)
shadow.cljs.devtools.server.util/server-thread/fn--15399/fn--15400/fn--15408 (util.clj:283)
shadow.cljs.devtools.server.util/server-thread/fn--15399/fn--15400 (util.clj:282)
shadow.cljs.devtools.server.util/server-thread/fn--15399 (util.clj:255)
java.lang.Thread.run (Thread.java:829)
Caused by:
NullPointerException:
One more trace...
npx shadow-cljs watch app
shadow-cljs - config: /home/diego/www/berp/shadow-cljs.edn
[:app] Compiling ...
failed to convert sources
{:tag :shadow.build.closure/convert-error, :sources [[:shadow.build.npm/resource "node_modules/object-assign/index.js"]
... more node modules
[:shadow.build.npm/resource "node_modules/bwip-js/dist/bwip-js.js"]]}
ExceptionInfo: failed to convert sources
shadow.build.closure/convert-sources-simple*/fn--13152 (closure.clj:2072)
shadow.build.closure/convert-sources-simple* (closure.clj:2059)
shadow.build.closure/convert-sources-simple* (closure.clj:1923)
shadow.build.closure/convert-sources-simple (closure.clj:2233)
shadow.build.closure/convert-sources-simple (closure.clj:2183)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1385)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1378)
shadow.build.compiler/compile-all (compiler.clj:1634)
shadow.build.compiler/compile-all (compiler.clj:1497)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.api/release* (api.clj:338)
shadow.cljs.devtools.api/release* (api.clj:324)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:28)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:25)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:49)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:38)
shadow.cljs.devtools.cli-actual/main/body-fn--16578--auto----17242 (cli_actual.clj:166)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:165)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)
clojure.core/apply (core.clj:671)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:667)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli/-main (cli.clj:75)
shadow.cljs.devtools.cli/-main (cli.clj:67)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:667)
clojure.main/main-opt (main.clj:514)
clojure.main/main-opt (main.clj:510)
clojure.main/main (main.clj:664)
clojure.main/main (main.clj:616)
clojure.lang.Var.applyTo (Var.java:705)
clojure.main.main (main.java:40)
Caused by:
RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
null
Node(BLOCK): node_modules/bwip-js/dist/bwip-js.js:6352:30
$_.drawlayer = function() {
Parent(FUNCTION ): node_modules/bwip-js/dist/bwip-js.js:6352:19
$_.drawlayer = function() {
com.google.javascript.jscomp.Compiler.throwInternalError (Compiler.java:3269)
com.google.javascript.jscomp.NodeTraversal.throwUnexpectedException (NodeTraversal.java:509)
com.google.javascript.jscomp.NodeTraversal.traverseRoots (NodeTraversal.java:553)
com.google.javascript.jscomp.NodeTraversal$Builder.traverseRoots (NodeTraversal.java:473)
com.google.javascript.jscomp.FlowSensitiveInlineVariables.process (FlowSensitiveInlineVariables.java:277)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:240)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:179)
com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations (Compiler.java:2969)
com.google.javascript.jscomp.Compiler.lambda$stage2Passes$7 (Compiler.java:1031)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:126)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:1079)
com.google.javascript.jscomp.Compiler.stage2Passes (Compiler.java:1028)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:914)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:566)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.closure/convert-sources-simple*/fn--13152/fn--13153 (closure.clj:2062)
shadow.build.closure/convert-sources-simple*/fn--13152 (closure.clj:2060)
shadow.build.closure/convert-sources-simple* (closure.clj:2059)
shadow.build.closure/convert-sources-simple* (closure.clj:1923)
shadow.build.closure/convert-sources-simple (closure.clj:2233)
shadow.build.closure/convert-sources-simple (closure.clj:2183)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1385)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1378)
shadow.build.compiler/compile-all (compiler.clj:1634)
shadow.build.compiler/compile-all (compiler.clj:1497)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.api/release* (api.clj:338)
shadow.cljs.devtools.api/release* (api.clj:324)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:28)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:25)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:49)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:38)
shadow.cljs.devtools.cli-actual/main/body-fn--16578--auto----17242 (cli_actual.clj:166)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:165)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)
clojure.core/apply (core.clj:671)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:667)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli/-main (cli.clj:75)
shadow.cljs.devtools.cli/-main (cli.clj:67)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:667)
clojure.main/main-opt (main.clj:514)
clojure.main/main-opt (main.clj:510)
clojure.main/main (main.clj:664)
clojure.main/main (main.clj:616)
clojure.lang.Var.applyTo (Var.java:705)
clojure.main.main (main.java:40)
Caused by:
NullPointerException:
com.google.javascript.rhino.HamtPMap.equivalent (HamtPMap.java:412)
com.google.javascript.jscomp.MaybeReachingVariableUse$ReachingUses.equalMaps (MaybeReachingVariableUse.java:164)
com.google.javascript.rhino.HamtPMap.equivalent (HamtPMap.java:439)
com.google.javascript.rhino.HamtPMap.equivalent (HamtPMap.java:411)
com.google.javascript.jscomp.MaybeReachingVariableUse$ReachingUses.equals (MaybeReachingVariableUse.java:160)
com.google.javascript.jscomp.DataFlowAnalysis.flow (DataFlowAnalysis.java:304)
com.google.javascript.jscomp.DataFlowAnalysis.analyze (DataFlowAnalysis.java:225)
com.google.javascript.jscomp.FlowSensitiveInlineVariables.enterScope (FlowSensitiveInlineVariables.java:206)
com.google.javascript.jscomp.NodeTraversal.pushScope (NodeTraversal.java:1155)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:936)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:1008)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:905)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:1008)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:905)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:1008)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:905)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseFunction (NodeTraversal.java:1008)
com.google.javascript.jscomp.NodeTraversal.handleFunction (NodeTraversal.java:859)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:905)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseChildren (NodeTraversal.java:1136)
com.google.javascript.jscomp.NodeTraversal.handleScript (NodeTraversal.java:847)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:902)
com.google.javascript.jscomp.NodeTraversal.traverseBranch (NodeTraversal.java:953)
com.google.javascript.jscomp.NodeTraversal.traverseRoots (NodeTraversal.java:549)
com.google.javascript.jscomp.NodeTraversal$Builder.traverseRoots (NodeTraversal.java:473)
com.google.javascript.jscomp.FlowSensitiveInlineVariables.process (FlowSensitiveInlineVariables.java:277)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:240)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:179)
com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations (Compiler.java:2969)
com.google.javascript.jscomp.Compiler.lambda$stage2Passes$7 (Compiler.java:1031)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:126)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:1079)
com.google.javascript.jscomp.Compiler.stage2Passes (Compiler.java:1028)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:914)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0
... continue next comment
(NativeMethodAccessorImpl.java:-2)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:566)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.closure/convert-sources-simple*/fn--13152/fn--13153 (closure.clj:2062)
shadow.build.closure/convert-sources-simple*/fn--13152 (closure.clj:2060)
shadow.build.closure/convert-sources-simple* (closure.clj:2059)
shadow.build.closure/convert-sources-simple* (closure.clj:1923)
shadow.build.closure/convert-sources-simple (closure.clj:2233)
shadow.build.closure/convert-sources-simple (closure.clj:2183)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1385)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1378)
shadow.build.compiler/compile-all (compiler.clj:1634)
shadow.build.compiler/compile-all (compiler.clj:1497)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.api/release* (api.clj:338)
shadow.cljs.devtools.api/release* (api.clj:324)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:28)
shadow.cljs.devtools.cli-actual/do-build-command (cli_actual.clj:25)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:49)
shadow.cljs.devtools.cli-actual/do-build-commands (cli_actual.clj:38)
shadow.cljs.devtools.cli-actual/main/body-fn--16578--auto----17242 (cli_actual.clj:166)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:165)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)
clojure.core/apply (core.clj:671)
clojure.core/apply (core.clj:662)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)
clojure.lang.Var.applyTo (Var.java:705)
Unfortunately it happens deeps inside the closure compiler, so not much I can do about it
"luckily" it also reproduces with the closure compiler alone, so that is something to report to them and maybe it gets fixed
otherwise you can follow this, so that shadow-cljs doesn't try to process the problem code
I have tried the option that you mention js-external-provider, while they respond. I don't know if I did it right, but it can't find the function or the file
(.toSVG js/bwipjs
(clj->js {:bcid bcid
:text texto
:scale escala
:js-options {:js-provider :external
:external-index "node_modules/bwip-js/dist/bwip-js.js"
:external-index-format :esm}}
Error:
Uncaught ReferenceError: bwipjs is not defined
this is not how that works at all. the :external-index
file needs to be processed by webpack and that output needs to be loaded in your html
on the CLJS side you just require things as normal, there is no such thing as js/bwipjs
created by this
so you can just skip all this and just put this script tag in your HTML <script type="text/javascript" src="file-or-url-path-to/bwip-js/dist/bwip-js-min.js"></script>
with the file-or-url being to a file you manually copied, and then really just use js/bwipjs
that way no processing of the file is done at all. in fact shadow-cljs never sees it at all