Fork me on GitHub
#portal
<
2023-06-08
>
Sam Ritchie18:06:56

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

Sam Ritchie18:06:56

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

Sam Ritchie18:06:50

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

Sam Ritchie18:06:00

@djblue maybe a resolution error from the nested package?

djblue19:06:50

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

djblue19:06:04

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

Sam Ritchie19:06:26

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

djblue19:06:52

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

Sam Ritchie19:06:38

@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

Sam Ritchie19:06:09

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

Sam Ritchie19:06:36

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…

Sam Ritchie19:06:51

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

djblue19:06:42

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

Sam Ritchie19:06:13

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

Sam Ritchie19:06:29

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

Sam Ritchie19:06:58

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

Sam Ritchie19:06:46

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

djblue19:06:18

How would I go about trying this?

Sam Ritchie19:06:39

setting you up, one sec

Sam Ritchie19:06:57

@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)