portal 2023-06-08

okay, working on the next library… @djblue any ideas here?

Thu Jun 08 12:18:38 MDT 2023 [worker-3] ERROR - POST /load
clojure.lang.ExceptionInfo: Unable to find node module: "dequal/lite" {:module "dequal/lite", :search-paths ("/Users/sritchie/code/clj/emmy-viewers/node_modules/leva/dist/node_modules" "/Users/sritchie/code/clj/emmy-viewers/node_modules/leva/node_modules" "/Users/sritchie/code/clj/emmy-viewers/node_modules/node_modules" "/Users/sritchie/code/clj/emmy-viewers/node_modules" "/Users/sritchie/code/clj/node_modules" "/Users/sritchie/code/node_modules" "/Users/sritchie/node_modules" "/Users/node_modules" "/node_modules")}
that folder does indeed exist:
(base) [sritchie@wintermute ~/code/clj/emmy-viewers (sritchie/leva)]$ ll node_modules/dequal/lite
total 32
drwxrwx---  6 sritchie  staff  192 Jun  1 07:27 .
drwxrwx---  8 sritchie  staff  256 Jun  1 07:27 ..
-rw-rw----  1 sritchie  staff   52 Jun  1 07:27 index.d.ts
-rw-rw----  1 sritchie  staff  802 Jun  1 07:27 index.js
-rw-rw----  1 sritchie  staff  658 Jun  1 07:27 index.min.js
-rw-rw----  1 sritchie  staff  784 Jun  1 07:27 index.mjs

ah, the issue is that goog.object is not recognized…

okay, even with that fixed I still have the error about not finding the node module

@djblue maybe a resolution error from the nested package?

You are correct, I seem to have missed one of the many flavors of require 👌

require('dequal/lite/index.js') works

unfortunately this require style is inside of ANOTHER npm dependency that I don’t control…

I think I have a fix, running tests real quick 👍

@djblue and then trying to require mathbox gives me another error that I’ll have to track down:

Execution error (ExceptionInfo) at portal.runtime.jvm.launcher/eval-str (launcher.clj:124).
Cannot use import statement outside a module

I’ll give that a go shortly, that should unlock https://leva.mentat.org/ for me.

then I have to find where this import statement is? mathbox builds fine with cljs so I don’t THINK there are any invalid import statements…

maybe there is something weird that webpack is understanding and resolving?

Yeah, I would expect most code in node_modules to use require 🤔 And the resolution algorithm is not looking for .mjs files

I will save that for a more spacious day, and start at the bottom (maybe something in threejs?) and try and track down the error

if we can get mathbox examples loading in portal like this…

haha nothing else will be close in the “visual REPL” world 🙂

that little control panel will totally work,that’s what your fix enables. And if you have multiple tapped values , their controllers will stack up with headings, and only the relevant input controls will get erased when you erase a value

How would I go about trying this?

setting you up, one sec

@djblue oh to get the portal dependency up you’ll need both the :nextjournal/clerk and :portal profiles (obviously you have this part set up)

@djblue totally works