-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nbb does not launch on GraalVM's distribution of nodejs #118
Comments
Oh wow, I didn't think of that use case yet. Thank you! |
@littleli It seems to be related to dynamic import. This works though. So as long as you use only clojure core stuff and
|
It seems the regular interop isn't working for nodejs on Graal $ $GRAALVM_HOME/bin/node --jvm --polyglot out/nbb_main.js -e '(def bigint (js/Java.type "java.math.BigInteger")) (-> (.valueOf bigint 2))'
----- Error --------------------------------------
Type: TypeError
Message: invokeMember (apply) on java.lang.Class.valueOf failed due to: Message not supported.
invokeMember (apply) on java.lang.Class.valueOf failed due to: Message not supported. But using $ $GRAALVM_HOME/bin/node --jvm --polyglot out/nbb_main.js -e '(def bigint (js/Java.type "java.math.BigInteger")) (-> (js/Reflect.apply (.-valueOf bigint) nil #js [2]) str)'
"2" Perhaps the interop in SCI should default to |
A repro in pure JS: > var BigInteger = Java.type('java.math.BigInteger');
> var x = BigInteger.valueOf.apply(BigInteger, [10])
Uncaught:
TypeError: invokeMember (apply) on java.lang.Class.valueOf failed due to: Message not supported.
> var x = Reflect.apply(BigInteger.valueOf, BigInteger, [10])
undefined
> x.toString()
'10' |
Btw, it seems now that $ GRAALVM_HOME/bin/node out/nbb_main.js -e '(ns foo (:require ["path" :as path])) (path/resolve "README.md")'
"/Users/borkdude/Dropbox/dev/clojure/nbb/README.md" I have asked on the graalvm slack why the first example using |
Reply from Graal Slack: Jan Štola 3 minutes ago Jan Štola < 1 minute ago |
Should be fixed in 0.1.4, releasing on CI |
Also got this response from the GraalVM slack:
|
I used the latest GraalVM (21.3.0) on MacOS (Big Sur)
After installing nodejs with
gu
:I installed nbb and received this output, so it apears to be happy:
but after I try to run it it ends up with following error:
If there is a minimal possibility to make it work 🙏🏻
I think there is a huge opportunity to direct interop between nodejs<->java interop using GraalVM, and so is for
nbb
.The text was updated successfully, but these errors were encountered: