This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-28
Channels
- # asami (1)
- # aws (9)
- # babashka (16)
- # beginners (32)
- # calva (2)
- # clj-kondo (20)
- # cljdoc (6)
- # clojure (35)
- # clojure-dev (25)
- # clojure-europe (11)
- # clojure-india (1)
- # clojure-norway (2)
- # clojure-spec (26)
- # clojure-uk (1)
- # clojurescript (41)
- # conjure (3)
- # css (9)
- # cursive (18)
- # data-oriented-programming (6)
- # data-science (2)
- # emacs (47)
- # events (1)
- # fulcro (15)
- # graalvm (30)
- # gratitude (7)
- # honeysql (27)
- # inf-clojure (4)
- # introduce-yourself (2)
- # lsp (129)
- # malli (7)
- # missionary (21)
- # nbb (17)
- # off-topic (18)
- # re-frame (6)
- # releases (1)
- # shadow-cljs (120)
- # vim (7)
- # xtdb (15)
@colliderwriter :paths
is deps.edn and therefore the rules of tools.deps apply. basically you need to use :local/root
if you want to get outside the project
In my trying to make the smallest reproduction I figured out a rather stupid mistake: had up-to-date shadow-cljs in my clj deps, but in my devDependencies of node it was still on 2.17.4
Getting further now with thes :esm
build but hitting:
[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve './cljs-runtime/shadow.module.notebookesm.prepend.js' in '/Users/baruchberger/opt/anaconda3/share/jupyter/lab/staging/node_modules/jupyter.compilation/lib'
and with :npm-module
watch build I'm hitting:
Module not provided: shadow.js.shim.module$$babel$runtime$helpers$interopRequireDefault
with :npm-module
release build I'm hitting:
ReferenceError: shadow$provide is not defined
Okay, I've added a comment to the issue https://github.com/thheller/shadow-cljs/issues/1039 with a repo
I think the :esm release build is very close. It might be some node dependency of the babel-transpiled library I'm importing?
tldr: If you have conda installed: conda install -c conda-forge jupyterlab or pip install jupyterlab If you are using a macOS version that comes with Python 2, run pip3 instead of pip.
try this build config
{:target :esm
:output-dir "lib"
:modules {:notebookesm {:exports-var notebook/extension}}
:runtime :browser
:js-options {:js-provider :import}}
$ jupyter lab --watch
[I 2022-07-28 10:45:12.917 ServerApp] jupyterlab | extension was successfully linked.
[I 2022-07-28 10:45:12.927 ServerApp] nbclassic | extension was successfully linked.
[I 2022-07-28 10:45:12.930 ServerApp] Writing Jupyter server cookie secret to /home/thheller/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2022-07-28 10:45:13.458 ServerApp] notebook_shim | extension was successfully linked.
[I 2022-07-28 10:45:13.600 ServerApp] notebook_shim | extension was successfully loaded.
[I 2022-07-28 10:45:13.601 LabApp] JupyterLab extension loaded from /home/thheller/.local/lib/python3.9/site-packages/jupyterlab
[I 2022-07-28 10:45:13.601 LabApp] JupyterLab application directory is /home/thheller/.local/share/jupyter/lab
[I 2022-07-28 10:45:13.602 LabApp] Starting JupyterLab watch mode...
-
It compiled the watch build with that, but again hit the shadow.module.notebookesm.prepend.js issue. After I pressed stop to try the release build I got a
[2022-07-28 17:20:57.673 - INFO] :shadow.build.npm/js-invalid-requires - {:resource-name "node_modules/@jupyterlab/codemirror/lib/mode.js", :requires [{:line 38, :column 20}]}
------ WARNING #1 - -----------------------------------------------------------
Resource: node_modules/h3-js/dist/browser/h3-js.js:674:2
@suppress annotation not allowed here. See
--------------------------------------------------------------------------------
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGBUS (0xa) at pc=0x00000001042039c4, pid=28319, tid=47875
#
# JRE version: OpenJDK Runtime Environment Homebrew (11.0.12) (build 11.0.12+0)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (11.0.12+0, mixed mode, tiered, compressed oops, g1 gc, bsd-aarch64)
# Problematic frame:
# V [libjvm.dylib+0x5279c4] _ZN15PcDescContainer21find_pc_desc_internalEPhbRK12PcDescSearch+0xf4
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/baruchberger/jupyter-compilation-target/hs_err_pid28319.log
Compiled method (c2) 1469217 22524 ! 4 clojure.core.async$mult$fn__9046$state_machine__7801__auto____9059$fn__9064::invoke (5095 bytes)
total in heap [0x00000001158cc590,0x00000001158e4620] = 98448
Hmm, the watch tends to take some time usually but that's probably not it :thinking_face:
X Compilation failed.
NullPointerException:
clojure.string/index-of (string.clj:327)
clojure.string/index-of (string.clj:319)
shadow.build.targets.esm/replace-goog-global* (esm.clj:334)
shadow.build.targets.esm/replace-goog-global* (esm.clj:328)
clojure.core/apply (core.clj:669)
clojure.core/update-in/up--6922 (core.clj:6220)
clojure.core/update-in/up--6922 (core.clj:6219)
clojure.core/update-in/up--6922 (core.clj:6219)
clojure.core/update-in (core.clj:6221)
clojure.core/update-in (core.clj:6207)
shadow.build.targets.esm/replace-goog-global (esm.clj:362)
shadow.build.targets.esm/replace-goog-global (esm.clj:350)
shadow.build.targets.esm/process (esm.clj:473)
shadow.build.targets.esm/process (esm.clj:465)
clojure.lang.Var.invoke (Var.java:384)
shadow.build/process-stage/fn--15861 (build.clj:163)
shadow.build/process-stage (build.clj:160)
shadow.build/process-stage (build.clj:152)
shadow.build/compile (build.clj:511)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.server.remote-ext/do-build/fn--20767 (remote_ext.clj:104)
clojure.core/binding-conveyor-fn/fn--5823 (core.clj:2047)
java.util.concurrent.FutureTask.run (FutureTask.java:264)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
java.lang.Thread.run (Thread.java:829)
{:deps {:aliases [:dev]}
:nrepl {:port 12000}
:builds {:notebook-esm
{:target :esm
:output-dir "lib"
:modules {:notebookesm {:exports-var notebook/extension}}
:runtime :browser
:js-options {:js-provider :import}}}}
ValueError:
"[email protected]" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab Extension Package
>=3.4.4 <3.5.0 3.3.2 @jupyterlab/application
>=3.4.4 <3.5.0 3.3.2 @jupyterlab/apputils
>=3.4.4 <3.5.0 3.3.2 @jupyterlab/launcher
>=3.4.4 <3.5.0 3.3.2 @jupyterlab/notebook
An error occurred.
ValueError:
"[email protected]" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab Extension Package
>=3.4.4 <3.5.0 3.3.2 @jupyterlab/application
>=3.4.4 <3.5.0 3.3.2 @jupyterlab/apputils
>=3.4.4 <3.5.0 3.3.2 @jupyterlab/launcher
>=3.4.4 <3.5.0 3.3.2 @jupyterlab/notebook
See the log file for details: /tmp/jupyterlab-debug-k6xty04m.log
Exiting application: lab
ok getting the
[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve './cljs-runtime/shadow.module.notebookesm.prepend.js' in '/home/thheller/.local/share/jupyter/lab/staging/node_modules/jupyter.compilation/lib'
I don't have time to test right now but a little later Iβll see where I get with this new info. Hopefully this also solves the third party js issue. Thank you so much π
I guess you meant
{:deps {:aliases [:dev]}
:nrepl {:port 12000}
:builds {:notebook-esm
{:target :esm
:output-dir "lib"
:modules {:notebookesm {:exports {extension notebook/extension}}}
:runtime :browser
:js-options {:js-provider :import}}}}
?It's not, made some adjustments to that codebase. Although we are in the process of adding this as an npm package.
{id: 'jupyter-compilation-target.notebook', autoStart: true, optional: Array(1), requires: Array(2), activate: Ζ} 'extension in index.js'
activate W {_started: true, _pluginMap: {β¦}, _serviceMap: Map(60), _delegate: e, commands: e, β¦} _e {_currentChanged: e, _isDisposed: false, _widgetAdded: e, _widgetUpdated: e, _focusTracker: e, β¦}
Noticed that v2.19.7 and newer seem to ship a version of the Closure Compiler that's not compatible with Java 8:
Ξ» java -version
openjdk version "1.8.0_272"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_272-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.272-b10, mixed mode)
Ξ» clj -Srepro -Sdeps '{:deps {thheller/shadow-cljs {:mvn/version "2.19.7"}}}' -M -m shadow.cljs.devtools.cli browser-repl
...
Caused by: java.lang.UnsupportedClassVersionError: 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
...
From the Closure Compiler release notes (https://github.com/google/closure-compiler/wiki/Releases#june-1st-2022-v20220601):
> Java 11 or newer is now required to run Closure Compiler.
Just a heads up. Guess there's little to be done about that.In the error messsage below, it seems like the shadow server is trying to call a method that doesn't exist. I assume this is because that method's library is set to a version that doesn't have it due to another project dependency. But i can't figure out where, is there a way to get more information? "com.google.javascript" or ".protobuf" doesn't appear in my package-json.lock or my deps file.
For java based builds i can use clj -Stree
what is the equivalent for shadow projects?
[:app] Compiling ...
[2022-07-28 11:42:00.658 - WARNING] :shadow.cljs.devtools.server.util/handle-ex - {:msg {:type :start-autobuild}}
NoSuchMethodError com.google.javascript.jscomp.serialization.ObjectTypeProto.emptyIntList()Lcom/google/protobuf/Internal$IntList;
com.google.javascript.jscomp.serialization.ObjectTypeProto.<init> (ObjectTypeProto.java:24)
com.google.javascript.jscomp.serialization.ObjectTypeProto.<clinit> (ObjectTypeProto.java:2379)
com.google.javascript.jscomp.serialization.TypeProto.<init> (TypeProto.java:63)
com.google.javascript.jscomp.serialization.TypeProto.<init> (TypeProto.java:15)
com.google.javascript.jscomp.serialization.TypeProto$1.parsePartialFrom (TypeProto.java:909)
com.google.javascript.jscomp.serialization.TypeProto$1.parsePartialFrom (TypeProto.java:903)
com.google.protobuf.CodedInputStream$StreamDecoder.readMessage (CodedInputStream.java:2315)
com.google.javascript.jscomp.serialization.TypePool.<init> (TypePool.java:66)
com.google.javascript.jscomp.serialization.TypePool.<init> (TypePool.java:15)
com.google.javascript.jscomp.serialization.TypePool$1.parsePartialFrom (TypePool.java:3283)
com.google.javascript.jscomp.serialization.TypePool$1.parsePartialFrom (TypePool.java:3277)
com.google.protobuf.CodedInputStream$StreamDecoder.readMessage (CodedInputStream.java:2315)
i'm going to bumb shadow to the latest to start...
that's all that i see in my terminal.
@U0DJ4T5U1: did you manage to resolve this error?
@U03CPPKDXBL i was, though i can't recall at this point what I did specifically. Probably just updated a dependency.
Glad to hear it, thanks @U0DJ4T5U1.
Good call, @U05224H0W. In my case, it was mysql/mysql-connector-java 8.0.19
that depended on com.google.protobuf/protobuf-java 3.6.1
. Upgraded to mysql/mysql-connector-java 8.0.30
, which seems to have done the trick.
@U05224H0W, thanks for putting together the guide. The https://shadow-cljs.github.io/docs/UsersGuide.html#_troubleshooting's recommendation to list all active dependencies using clj -A:dev:cljs -Stree
was really helpful!
I'm starting to appreciate your recommendation to manage all CLJS dependencies exclusively with Shadow CLJS.
For others interested, learn more here: https://github.com/thheller/shadow-cljs/issues/983#issuecomment-1041190965
I am going to hijack this thread and add my stackstrace for future lost souls, I had:
NoSuchMethodError 'com.google.protobuf.Internal$IntList com.google.javascript.jscomp.serialization.ObjectTypeProto.emptyIntList()'
com.google.javascript.jscomp.serialization.ObjectTypeProto.<init> (ObjectTypeProto.java:24)
com.google.javascript.jscomp.serialization.ObjectTypeProto.<clinit> (ObjectTypeProto.java:2391)
com.google.javascript.jscomp.serialization.TypeProto.<init> (TypeProto.java:63)
com.google.javascript.jscomp.serialization.TypeProto.<init> (TypeProto.java:15)
com.google.javascript.jscomp.serialization.TypeProto$1.parsePartialFrom (TypeProto.java:909)
com.google.javascript.jscomp.serialization.TypeProto$1.parsePartialFrom (TypeProto.java:903)
com.google.protobuf.CodedInputStream$StreamDecoder.readMessage (CodedInputStream.java:2424)
com.google.javascript.jscomp.serialization.TypePool.<init> (TypePool.java:66)
com.google.javascript.jscomp.serialization.TypePool.<init> (TypePool.java:15)
com.google.javascript.jscomp.serialization.TypePool$1.parsePartialFrom (TypePool.java:3283)
com.google.javascript.jscomp.serialization.TypePool$1.parsePartialFrom (TypePool.java:3277)
com.google.protobuf.CodedInputStream$StreamDecoder.readMessage (CodedInputStream.java:2424)
and it was caused by an older version of the mysql-connector as well, upgrading to mysql/mysql-connector-java 8.0.30 fixed it
I would have never suspected this one