Fork me on GitHub
#portal
<
2022-06-25
>
zeitstein20:06:25

New user here. The VS Code (Windows) extension fails to open using (p/open {:launcher :vs-code}) – just a blank document. Latest version of portal. Standard inspector works fine. Accompanying error:

djblue20:06:19

Portal doesn't use web workers for the extensions so that error feels unrelated. I can't seem to reproduce on my local instance of windows. Do you have any other pointers?

zeitstein20:06:55

Honestly don't know. What should I be looking at/for?

djblue20:06:44

So when you run (p/open {:launcher :vs-code}), a new vs-code tab opens in your editor but has no content?

djblue20:06:09

Anything interesting showing up in > Developer: Open Webview Developer Tools ?

seancorfield20:06:00

@U02E9K53C9L One thing to check: make sure the version of Portal your REPL is using is the same as the version of the extension you have installed in VS Code.

seancorfield20:06:23

(that's been a problem for some people, but mostly with the IntelliJ version of Portal I think? -- still, best to ensure you're using the latest version of Portal on the "backend" via the REPL since the "frontend" version in VS Code auto-updates)

seancorfield20:06:21

That's why my dot-clojure file uses "RELEASE" for the version of many dev tools https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L70-L71

zeitstein20:06:07

@U04V70XH6 Seems the versions match, 0.27.0. @U1G869VNV Expected active text editor! a Calva error.

seancorfield20:06:06

How are you actually starting Portal up? Are you evaluating that p/open call from some code in your editor?

seancorfield20:06:01

I am a Calva user and have a custom REPL snippet to start Portal when I have a Clojure file open -- see https://github.com/seancorfield/vscode-calva-setup/blob/develop/settings.json#L239-L243

zeitstein20:06:56

Saw that 🙂 But I wanted just to run through the API part of the readme. Yes, evaluating p/open from a file.

zeitstein21:06:30

Tried disabling all other extensions and running an older version of Calva without success. Going to bed, will pick this up tomorrow. Thanks!

tbtb22:06:54

I can see this commit(https://github.com/djblue/portal/pull/87/commits/28ae94d68941f153fb4af6d6b452d82bbb46f900) talking about adding the ability to add custom viewers, but is there a guide anywhere on doing this? I am a beginner, so I am probably making a newbie mistake, but I can (require '[portal.api :as p]) just fine, but when I do (require '[portal.ui.api :as uiapi]) to get access to register-viewer! it tells me it can't find it on the classpath. I'm running in a RPEL with clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.27.0"}}}' as listed on the http://github.com README Edited:Ah, answered my own question, kind of. The ui.api is only available if you have clojurescript as a dependency as well. I thought to try because I noticed that portal/ui/api was cljs rather than cljc.

djblue22:06:39

You shouldn't need cljs as a dependency, but that code needs to run in the portal UI context. The portal.api/eval-str fn will send cljs forms to the portal UI for evaluation 👌

djblue22:06:21

A extension guide is on my to-do list 👍