-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
starting browser-repl should print correct URL to console #1205
Comments
Hey Sebastian! I hope everything is going well. In short, every time you start a new project and run it with The purpose of the dashboard is to provide this broader view and allow you to inspect your project and its active instances in a more pragmatic way. I actually agree with you that perhaps these explanations should be more easily accessible in the Until then, I would like to say that I actually got to know this dashboard when I was studying Fulcro, in the explanatory videos published by Tony Kay (the attached link is exactly when I first came across this dashboard). I believe I have understood your question, but if there is any misunderstanding on my part, please correct me. I hope this helps you! Cheers |
Hi Guto and thanks for your nice, newbie-friendly explanation! I am a bit confused about Fulcro and the term "compilation server" (which I both never heard of before). Am I supposed to be using Fulcro, or would Fulcro be employed by shadow-cljs behind the scenes? If so, it seems like it's only halfway integrated when starting If all the answers are "no", which would not surprise me, then it still comes down to my phrased issue that only putting the correct URL (route) in the automagically opened browser -- and not on the terminal output as well" -- excludes users who run just plain shadow-cljs from a machine without a browser (probably without XDG or the like) and would access it via the network from a different machine. The parts on Fulcro and the explanations are certainly a good source of further knowledge and understanding for me. Thanks |
Which version did you use in all of this? There were some buggy versions a while ago where the I'm uncertain what the exact issue is though. Here is what I did in WSL:
Then change into that
Note that it printed the URL to open? |
That's interesting, my output was a bit terser:
then:
I am on Clojure 1.11.3, npm 9.2.0, OpenJDK 17.0.12 with an up-to-date Debian 12. shadow-cljs reports being version 2.28.15 ("via npm"). I do have the environment variables |
Unsetting all those environment variables, including
Just to be clear, I got the basic repl working by now, it's just the out-of-the-box experience that seems to be broken w.r.t. not mentioning the URL for the Browser REPL on my setup for unknown reasons. |
This is the code opening the Browser and then printing the URL should that fail. shadow-cljs/src/main/shadow/cljs/devtools/api.clj Lines 526 to 531 in 653dfa0
I suspect that it is just silently failing and not throwing an Exception. Thus shadow-cljs thinks it worked and doesn't print anything. I'm still on WSL1, so that might be the difference. I'll try to reproduce WSL2 later. |
I also traced it down to browse-url. Invoking on my side looks like this:
Reading through https://github.com/clojure/clojure/blob/ebcbdb65e12152fff23f53c2f43c17d783f9e800/src/clj/clojure/java/browse.clj As I don't know how involved it would be to change that behaviour upstream (it might break other uses), I think the easiest way to resolve my issue would be for shadow-cljs to print the URL anyway, not only after an Exception. P.S.:
|
Hi and thanks for an apparently very cool library!
I just tried starting out on Windows inside WSL2 with the npx quickstart. The WSL2 won't open a browser automagically when I start
npx shadow-cljs browser-repl
. Instead I took the terminal output and tried toGET /
on the local IP, which redirected me to/dashboard
, which only showed "Loading..." and nothing else, with the web-socket connected and sending ping and pong. I spent quite some time trying to figure out what could be wrong.It was only after trying on another machine with a graphical environment where I saw that the automagically opened browser is pointed to a different URL (
/repl-js/browser-repl
). Typing this on the first machine with the WSL2 setting also immediately works. If only I had known this earlier. So, bottom line, I think the URL to open in the browser should be printed on the console when starting browser-repl in a vanilla quickstarted project.N.B.: What is that
dashboard
anyway? Cannot seem to find that term in the UserGuide anywhere, though there are some closed Github issues containing that term.The text was updated successfully, but these errors were encountered: