Closed AlexAti closed 2 months ago
Hi @AlexAti, thanks for the report. Are you sure it's related to a change in Clerk rather than a change in the JVM version?
I'm not seeing anything related to this in the diff, see https://github.com/nextjournal/clerk/compare/v0.11.603...v0.12.699.
You can also try confirming that clojure.java.browse/browse-url
does not work on your system by running the following:
clj -M -e "((requiring-resolve 'clojure.java.browse/browse-url) \"https://clerk.vision\")"
Are you suggesting you think it would be better to fail silently if the browser does can't be opened? I think that might also lead to surprising behavior…
Hi @mk! Thanks for your work!
I required an old version of clerk that worked, and I spotted this after just upgrading the version in my deps.edn; afterwards I just did some manual binary search until I found the version that breaks it, so not sure about whether its clerk's code or dependencies, but it triggers just by jumping from v0.11.603.
My quick guess is that this should have always happened, but it was silently failing due the "coerge" typo that was fixed here.
Running the code you provided me also triggers the same error:
$ clj -M -e "((requiring-resolve 'clojure.java.browse/browse-url) \"https://clerk.vision\")"
Execution error (UnsupportedOperationException) at java.awt.Desktop/checkActionSupport (Desktop.java:381).
The BROWSE action is not supported on the current platform!
Full report at:
/tmp/clojure-174686366672381146.edn
As to whether to warn about the error or halt the attempt to serve files, it can be argued both ways! But to me launching the browser is an extra on top of the main intent (to serve files), and that way it would be more robust. Alternatively I'd strengthen the error message of the exception to advise to remove ":browse true".
But to me launching the browser is an extra on top of the main intent (to serve files), and that way it would be more robust.
@AlexAti agreed and implemented catching the exception in the commit above. Let me know if you think that's alright or feel free to open a PR with further suggestions.
I have the same issue: "BROWSE action is not supported" and Localhost not started.
Clojure 1.11.1 (clerk/serve! {:browse true}) Clerk webserver started on http://localhost:7777 ... Execution error (UnsupportedOperationException) at java.awt.Desktop/checkActionSupport (Desktop.java:381). The BROWSE action is not supported on the current platform!
I use Windows11 with WSL2 (Ubuntu 22.04.3 LTS) and Java Version:
openjdk version "17.0.11" 2024-04-16 OpenJDK Runtime Environment (build 17.0.11+9-Ubuntu-122.04.1) OpenJDK 64-Bit Server VM (build 17.0.11+9-Ubuntu-122.04.1, mixed mode, sharing)
The same Notebook was working yesterday, but now it is not working.
How can I solve this issue?
Jens
changing deps.epn from
:deps {
org.clojure/clojure {:mvn/version "1.11.1"}
io.github.nextjournal/clerk {:mvn/version "0.16.1016"}
}
to:
:deps {
org.clojure/clojure {:mvn/version "1.11.1"}
io.github.nextjournal/clerk {:mvn/version "0.11.603"}
}
solves the problem, but that is not a longterm solution.
Jens
Beginning release v0.12.699 (it works up until v0.11.603), clerk is not able to serve pages in my platform (openjdk 17 on top of a corporate wsl running debian), raising the following exception when evaluating
(clerk/serve! {:browse true :watch-paths ["src"]})
:Upon quick investigation, it seems that the fact that the browser can't be launched raises the exception and breaks the serve workflow. Although this is not directly related to clerk (see https://github.com/openmole/openmole/issues/140 for example), this should be avoidable at the clerk level, as serving the pages should be independent from the convenience of launching a new window...