This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-23
Channels
- # announcements (3)
- # architecture (10)
- # babashka (37)
- # beginners (69)
- # calva (2)
- # cider (10)
- # clerk (22)
- # clj-kondo (33)
- # cljdoc (44)
- # clojure (45)
- # clojure-conj (4)
- # clojure-denmark (7)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (4)
- # clojurescript (10)
- # clr (19)
- # conjure (1)
- # emacs (28)
- # events (1)
- # fulcro (1)
- # jobs (1)
- # joyride (1)
- # lsp (18)
- # malli (30)
- # membrane (3)
- # off-topic (23)
- # pathom (45)
- # portal (29)
- # proletarian (7)
- # rdf (15)
- # re-frame (21)
- # reagent (2)
- # releases (6)
- # remote-jobs (1)
- # reveal (6)
- # shadow-cljs (36)
- # slack-help (7)
- # sql (5)
- # tools-deps (3)
For some reason the Portal VS Code extension has stopped working for me. Windows/WSL2. Portal 0.35.1. The Portal window opens but it is blank. The .portal/vs-code.edn
file contains {:host "localhost", :port 43715}
but if I look in the developer tools, it looks like Portal is trying to hit this URL http://localhost:34737/main.js?12482da4-365e-4ad4-9a35-7923eefe0092 -- and if I do curl on that in WSL2, it succeeds (and returns a big blob of JS) but the developer tools indicate that is timing out (from the Windows side, presumably -- and a curl in cmd.exe seems to confirm that).
@U1G869VNV Any suggestions on how to debug this further? If I do that curl with 43715 on WSL2, it also succeeds (and returns the same blob of JS as far as I can tell) -- so it seems that Portal is running on multiple ports...?
There are two servers involved, one in the jvm process and another in the vscode process. The vscode.edn contains the server info for the one running in the vscode process.
Ah, ok.
The 34737 port is the server running in the jvm and the one you want to load the ui from
And that is failing to load for the extension, for some reason. I don't think I've changed anything on my machine -- and this was working just fine on Friday. Although I think Docker updated itself last night so I wonder if it has borked something about WSL2?
I don't know if http-kit binds to the public interface by default which might be the issue if something related to networking has changed :thinking_face:
nvm, it does https://github.com/http-kit/http-kit/blob/master/src/org/httpkit/server.clj#L75
Nope. I've even rebooted the whole machine and started everything back up.
The Portal extension is installed in WSL2, according to VS Code, so I would have assumed that when it requests the UI, it's doing it on the WSL2 side of things -- and curl succeeds for that...
Correct.
There's an update for Docker Desktop so I'm going to install that and reboot and try again... back in a bit...
Updated Docker and rebooted. Problem is still there 😞
Should that URL work in a browser on Windows? (i.e., does it work for you?)
It does. I wonder if you can not refer to the WSL2 instance via localhost anymore? :thinking_face:
If you get the ip of the wsl2 machine, you might be able to set it via (portal.api/start {:host "..."})
For the recent clr work I've done, localhost
didn't work and I needed to use ::1
which I think is the ipv6 equivalent
And it looks like ipv6 addresses have a special syntax to hit in a browser: http://[::1]:<port>/<path>
I can hit the WSL2 IP in a browser... so I'm going to update my Portal-start code to specify the host IP and see if that works...
Yeah, that fixed it. Thanks for the pointers...
(def ^{:doc "Atom for currently selected value."}
portal
((requiring-resolve 'portal.api/open)
{:launcher :vs-code
:host (-> (sh/sh "hostname" "-I") :out (str/trim))
:portal.launcher/window-title (System/getProperty "user.dir")}))
@U04V70XH6 Just ran into this issue myself and https://superuser.com/questions/1594420/cant-access-127-0-0-180-outside-of-wsl2-ubuntu-20-04 seems to have fixed it for me without needing to specify host, specifically:
Add a file with these contents to C:\Users\Me\.wslconfig:
[wsl2]
localhostForwarding=true
Yup! This totally works, thank you!
I've removed the hostname
shell-out and it all works.