{"id":15010633,"url":"https://github.com/28/openlayers-cljs-compile-error-repo","last_synced_at":"2025-10-03T20:31:36.360Z","repository":{"id":146776573,"uuid":"75386439","full_name":"28/openlayers-cljs-compile-error-repo","owner":"28","description":"A repo presenting a CLJS compile error I stumbled upon","archived":true,"fork":false,"pushed_at":"2018-03-15T21:37:11.000Z","size":21393,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-28T17:40:53.377Z","etag":null,"topics":["bug","clj","cljs","clojure","clojurescript","compiler"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/28.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-02T10:37:14.000Z","updated_at":"2023-12-27T07:45:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"83a71a19-6ad6-43e7-9e7d-9b7e4e8283d8","html_url":"https://github.com/28/openlayers-cljs-compile-error-repo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/28%2Fopenlayers-cljs-compile-error-repo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/28%2Fopenlayers-cljs-compile-error-repo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/28%2Fopenlayers-cljs-compile-error-repo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/28%2Fopenlayers-cljs-compile-error-repo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/28","download_url":"https://codeload.github.com/28/openlayers-cljs-compile-error-repo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235184249,"owners_count":18949250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bug","clj","cljs","clojure","clojurescript","compiler"],"created_at":"2024-09-24T19:35:09.880Z","updated_at":"2025-10-03T20:31:34.917Z","avatar_url":"https://github.com/28.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openlayers-cljs-compile-error-repo\n\nI've created this repo to present the error I encountered while developing a cljs project that it included [openlayers](https://github.com/cljsjs/packages/tree/master/openlayers) lib in its deps.\n\nThe error message is: *java.io.IOException: The filename, directory name, or volume label syntax is incorrect*. This error only happens on Windows (I tested it on a Linux machine also).\n\nThis was tested with Java 8 on Windows 10 with Clojure and ClojureScript\nversions 1.8.0 and 1.9.293 respectfully and openlayers 3.15.1 version.\n\nThe problem presentation is based on [ClojureScript Quick start guide](https://clojurescript.org/guides/quick-start). It shows a minimal representation of the problem.\n\nHere is the example stacktrace:\n\n```\nCopying jar:file:/C:/Users/****/Documents/Projects/openlayers-cljs-compile-error-repo/openlayers-3.15.1.jar!/cljsjs/openlayers/development/ol/events/event.js to out\\file:\\C:\\Users\\****\\Documents\\Projects\\openlayers-cljs-compile-error-repo\\openlayers-3.15.1.jar!\\\ncljsjs\\openlayers\\development\\ol\\events\\event.js\nException in thread \"main\" java.io.IOException: The filename, directory name, or volume label syntax is incorrect, compiling:(C:\\Users\\****\\Documents\\Projects\\openlayers-cljs-compile-error-repo\\build.clj:3:1)\n        at clojure.lang.Compiler.load(Compiler.java:7391)\n        at clojure.lang.Compiler.loadFile(Compiler.java:7317)\n        at clojure.main$load_script.invokeStatic(main.clj:275)\n        at clojure.main$script_opt.invokeStatic(main.clj:335)\n        at clojure.main$script_opt.invoke(main.clj:330)\n        at clojure.main$main.invokeStatic(main.clj:421)\n        at clojure.main$main.doInvoke(main.clj:384)\n        at clojure.lang.RestFn.invoke(RestFn.java:408)\n        at clojure.lang.Var.invoke(Var.java:379)\n        at clojure.lang.AFn.applyToHelper(AFn.java:154)\n        at clojure.lang.Var.applyTo(Var.java:700)\n        at clojure.main.main(main.java:37)\nCaused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect\n        at java.io.WinNTFileSystem.canonicalize0(Native Method)\n        at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428)\n        at java.io.File.getCanonicalPath(File.java:618)\n        at java.io.File.getCanonicalFile(File.java:643)\n        at cljs.util$mkdirs.invokeStatic(util.cljc:103)\n        at cljs.closure$write_javascript.invokeStatic(closure.clj:1566)\n        at cljs.closure$source_on_disk.invokeStatic(closure.clj:1590)\n        at cljs.closure$output_unoptimized$fn__4569.invoke(closure.clj:1629)\n        at clojure.core$map$fn__4785.invoke(core.clj:2646)\n        at clojure.lang.LazySeq.sval(LazySeq.java:40)\n        at clojure.lang.LazySeq.seq(LazySeq.java:49)\n        at clojure.lang.RT.seq(RT.java:521)\n        at clojure.core$seq__4357.invokeStatic(core.clj:137)\n        at clojure.core$filter$fn__4812.invoke(core.clj:2700)\n        at clojure.lang.LazySeq.sval(LazySeq.java:40)\n        at clojure.lang.LazySeq.seq(LazySeq.java:56)\n        at clojure.lang.RT.seq(RT.java:521)\n        at clojure.core$seq__4357.invokeStatic(core.clj:137)\n        at clojure.core$map$fn__4785.invoke(core.clj:2637)\n        at clojure.lang.LazySeq.sval(LazySeq.java:40)\n        at clojure.lang.LazySeq.seq(LazySeq.java:49)\n        at clojure.lang.Cons.next(Cons.java:39)\n        at clojure.lang.RT.boundedLength(RT.java:1749)\n        at clojure.lang.RestFn.applyTo(RestFn.java:130)\n        at clojure.core$apply.invokeStatic(core.clj:646)\n        at cljs.closure$deps_file.invokeStatic(closure.clj:1330)\n        at cljs.closure$output_deps_file.invokeStatic(closure.clj:1352)\n        at cljs.closure$output_unoptimized.invokeStatic(closure.clj:1639)\n        at cljs.closure$output_unoptimized.doInvoke(closure.clj:1620)\n        at clojure.lang.RestFn.applyTo(RestFn.java:139)\n        at clojure.core$apply.invokeStatic(core.clj:648)\n        at cljs.closure$build.invokeStatic(closure.clj:1975)\n        at cljs.build.api$build.invokeStatic(api.clj:198)\n        at cljs.build.api$build.invoke(api.clj:187)\n        at cljs.build.api$build.invokeStatic(api.clj:190)\n        at cljs.build.api$build.invoke(api.clj:187)\n        at user$eval24.invokeStatic(build.clj:3)\n        at user$eval24.invoke(build.clj:3)\n        at clojure.lang.Compiler.eval(Compiler.java:6927)\n        at clojure.lang.Compiler.load(Compiler.java:7379)\n        ... 11 more\n```\n\nNote: User name is masked with '*' but it is consisted of ASCII characters, not spaces or weird letters.\n\n### Linux observations\n\nNo error is raised on Linux machines, but the \"error\" exists. Dependency path is not separated as it\nshould - it still contains full file URL from jar file, but on Linux ! and : in file path doesn't make\na problem. See the example:\n\n```\ngoog.addDependency(\"../file:/home/****/Documents/openlayers-cljs-compile-error-repo/openlayers-3.15.1.jar!/cljsjs/openlayers/development/ol/events/event.js\", ['ol.events.Event'], []);\n...\n```\n\n### Fix\n\nIssue is reported on ClojureScript Jira here [CLJS-1868](http://dev.clojure.org/jira/browse/CLJS-1868).\n\nhe problem was in the function that produced relative output paths for deps (lib-rel-path).\nIt tried to remove the first part of the absolute path with clojure.string/replace, but\nit tried it with a wrong match (it did not reproduce the actual first part of the path)\nso it effectively did nothing.\n\nExample:\n`(str (io/file (System/getProperty \"user.dir\") lib-path) File/separator)`\nproduced:\n\n`file:\\C:\\Users\\****\\Documents\\Projects\\openlayers-cljs-compile-error-repo\\cljsjs\\openlayers\\development\\`\n\ninstead of\n\n`file:\\C:\\Users\\****\\Documents\\Projects\\openlayers-cljs-compile-error-repo\\openlayers-3.15.1.jar!\\cljsjs\\openlayers\\development\\`\n\nThis [fix](CLJS-1868.patch) was submitted to [CLJS-1868](http://dev.clojure.org/jira/browse/CLJS-1868).\n\n**The patch has been applied in this [commit](https://github.com/clojure/clojurescript/commit/9e5b7ac64dd0388d3403f48381c80ba1e3998da8), thus solving the issue.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F28%2Fopenlayers-cljs-compile-error-repo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F28%2Fopenlayers-cljs-compile-error-repo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F28%2Fopenlayers-cljs-compile-error-repo/lists"}