This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-20
Channels
- # announcements (16)
- # aws (1)
- # babashka (24)
- # beginners (54)
- # calva (25)
- # cider (4)
- # cljs-dev (2)
- # clojure (16)
- # clojure-dev (39)
- # clojure-europe (18)
- # clojure-nl (1)
- # clojure-uk (4)
- # clojurescript (66)
- # core-async (16)
- # cursive (13)
- # datomic (15)
- # deps-new (1)
- # duct (22)
- # fulcro (20)
- # jobs-discuss (1)
- # kaocha (3)
- # lsp (11)
- # malli (8)
- # off-topic (38)
- # other-languages (18)
- # polylith (18)
- # portal (15)
- # react (2)
- # reagent (9)
- # reitit (7)
- # releases (10)
- # reveal (1)
- # sci (13)
- # shadow-cljs (3)
- # specter (4)
- # sql (4)
- # xtdb (16)
Is anyone running Portal on a Windows/WSL2 setup, with the REPL/Portal running on Linux?
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.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)
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 😬
I got a similar error in 0.15.0
but it works in 0.14.0
.
I can confirm that it works on WSL2 with 0.15.1 -- opening a Google Chrome window with the inspector displayed correctly! Thank you!
(that doesn't happen every time it seems -- depends whether I specify a port or maybe it depends which port I specify)
I tried 0.14.0 and got the same behavior.
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?
I've done this. I can connect to portal with a web browser, but tap> doesn't appear to send anything to portal
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.
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
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.
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!