Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

I think that the following line might cause the problem on windows:
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/repl.cljc#L713

For file param e.g. "src\duct3\client.cljs"

(str "file://" (.getAbsolutePath file))

evaluates on windows as:
"file://C:\Projects\Playground\duct3\src\duct3\client.cljs"

which is not legal file Url (https://en.wikipedia.org/wiki/File_URI_scheme#Windows)

and final result is: java.net.UnknownHostException (java treat that URL as FTP address).

11 Answers

0 votes
by
0 votes
by

Comment made by: vojko

Added different prefix for windows platform.

0 votes
by

Comment made by: vojko

Attached patch.

0 votes
by

Comment made by: admin

Please don't mark issues resolved - only project admins like dnolen or mfikes should do that.

0 votes
by

Comment made by: mfikes

I wonder if the {{file://}} string construct is necessary.

If not, then a simpler patch would involve replacing the expression

(ana/analyze-file (str "file://" (.getAbsolutePath file)) opts)

with

(ana/analyze-file file opts)

0 votes
by

Comment made by: vojko

I have tried WO "file://", as you have said, and it works perfectly.
Thx!

0 votes
by

Comment made by: mfikes

Hey David, even though you marked this one as accepted, my take on the above was that I had suggested perhaps a cleaner way to Vojimir, he had tried it, and it worked for him. I think we'd be interested in Vojimir's cleaner patch.

0 votes
by

Comment made by: vojko

Hi Mike, I have attached a new patch with your suggested approach.

0 votes
by

Comment made by: mfikes

CLJS-2155-2.patch passes CI (/)

0 votes
by

Comment made by: mfikes

CLJS-2155-2.patch added to Patch Tender (i)

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2155 (reported by vojko)
...