Fork me on GitHub
#portal
<
2021-09-20
>
seancorfield04:09:09

Is anyone running Portal on a Windows/WSL2 setup, with the REPL/Portal running on Linux?

seancorfield04:09:14

I saw the announcement and figured I'd try Portal again but when I try it in a WSL2 REPL like this:

$ clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.15.0"}}}'
Clojure 1.10.3
user=> (require '[portal.api :as p])
nil
user=> (p/open)
{:session-id #uuid "d2c48f95-a60e-4187-a3a8-39ffbc08e23f"}
user=>
and it pops open a browser window but it's blank. Even after adding the tap and sending some values, nothing appears.

seancorfield04:09:43

I get this error showing up in the REPL:

Sun Sep 19 21:35:02 PDT 2021 [worker-2] ERROR - GET /main.js
java.lang.IllegalArgumentException: Not a file: jar:file:/home/seanc/.m2/repository/djblue/portal/0.15.0/portal-0.15.0.jar!/portal/main.js
        at $fn__11416.invokeStatic(io.clj:61)
        at $fn__11416.invoke(io.clj:44)
        at $fn__11390$G__11372__11395.invoke(io.clj:35)
        at $file.invokeStatic(io.clj:424)
        at $file.invoke(io.clj:418)
        at portal.runtime.jvm.server$main_js.invokeStatic(server.clj:85)
        at portal.runtime.jvm.server$main_js.invoke(server.clj:81)
        at portal.runtime.jvm.server$handler$fn__1687.invoke(server.clj:107)
        at portal.runtime.jvm.server$handler.invokeStatic(server.clj:111)
        at portal.runtime.jvm.server$handler.invoke(server.clj:102)
        at clojure.lang.Var.invoke(Var.java:384)
        at org.httpkit.server.HttpHandler.run(RingHandler.java:117)

djblue06:09:39

It looks like I did push up a broken release for all platforms, not sure if this is a WSL only issue. https://github.com/djblue/portal/commit/70213ad303669f91c51bd6b158e9ab6daca06162 should fix it, hopefully for WSL as well 🤞. Sorry 😬

tengstrand11:09:05

I got a similar error in 0.15.0 but it works in 0.14.0.

seancorfield16:09:12

I can confirm that it works on WSL2 with 0.15.1 -- opening a Google Chrome window with the inspector displayed correctly! Thank you!

seancorfield04:09:24

(that doesn't happen every time it seems -- depends whether I specify a port or maybe it depends which port I specify)

seancorfield04:09:36

I tried 0.14.0 and got the same behavior.

tvaughan12:09:40

Should it be possible to run a portal server in one process, e.g. using portal.api/start as exec-fn on the command-line, and then connect to it, something like (add-tap #'portal/submit) (tap> "Hello, Portal!"), in another process, e.g. in a clojure repl?

tvaughan12:09:37

I've done this. I can connect to portal with a web browser, but tap> doesn't appear to send anything to portal

seancorfield16:09:12

You'd need to add-tap a function that sent values over the wire to the other process (and then tap>'d them on that side). What you're doing now just tap>'s the values into a (presumably) non-running Portal in "this" JVM's process.

tvaughan19:09:04

Understood. I had added portal as a component and that worked. Now I'd like to make the two processes (portal and the app) separate. I don't need this to be "remote," just between different processes, so shared memory could work, for example. I was hoping portal had something built in, but I guess not. Thanks @U04V70XH6

djblue05:09:33

Hi @U0P7ZBZCK, the remote runtime work I recently added to portal is more along the lines of connecting via a socket repl to an existing process without portal and injecting the runtime code and linking up the remote runtime with a local client.

tvaughan13:09:13

Hey @U1G869VNV. My motivation is to ensure that portal is never shipped with the production app, and would only be available in local development. I just realized I can put everything in the user namespace, and only have portal on the classpath when a repl is started. I think this accomplishes my goal. Thanks for the response and thanks for portal!

👍 2