Comments (8)
A fix would likely be to check to see if window is defined, as it is not in webworkers.
from boot-reload.
Thanks that's a good catch. Do you know if reloading is technically possible within web Workers?
A similar issue (related to iOS) has been tracked in #56.
from boot-reload.
Couldn't say, but I suspect not. But then I'm really surprised that reloading is possible at all.
from boot-reload.
Oh, one thought. (But first realize that I am not a js dev!)
I was reading that in a webworker you should use self instead of the window object.
from boot-reload.
Found it. In https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#web-workers-api
Thus, using the window shortcut to get the current global scope (instead of self) within a Worker will return an error.
from boot-reload.
Installed your updated code on my system and reran the boot-based servant-demo after reinstating reload in the dev task. Ran fine. Then I added a blank line to the end of the core.cljs file and saved the file. Crash. Unable to delete file.
So your fix may be good, but it raises another issue--not sure where.
See below:
C:\Users\Bill\Documents\aatree\aademos\servant-demo>boot dev
Starting reload server on ws://localhost:64938
Writing boot_reload.cljs...
Writing boot_cljs_repl.cljs...
Starting file watcher (CTRL-C to quit)...
nREPL server started on port 64939 on host 127.0.0.1 - nrepl://127.0.0.1:64939
Writing main.cljs.edn...
Compiling ClojureScript...
ò main.js
Starting Jetty on port 9000...
2016-01-30 20:42:12.196:INFO::clojure-agent-send-off-pool-0: Logging initialized @31951ms
2016-01-30 20:42:12.257:INFO:oejs.Server:clojure-agent-send-off-pool-0: jetty-9.3.1.v20150714
2016-01-30 20:42:12.366:INFO:oejw.StandardDescriptorProcessor:clojure-agent-send-off-pool-0: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2016-01-30 20:42:12.394:INFO:oejsh.ContextHandler:clojure-agent-send-off-pool-0: Started o.e.j.w.WebAppContext@53d65750{/,file:///C:/Users/Bill/.boot/cache/tmp/Users/Bill/Documents/aatree/aademos/servant-demo/ci0/s0070k/,AVAILABLE}
2016-01-30 20:42:12.412:INFO:oejs.ServerConnector:clojure-agent-send-off-pool-0: Started ServerConnector@302d4cd6{HTTP/1.1,[http/1.1]}{0.0.0.0:9000}
2016-01-30 20:42:12.419:INFO:oejs.Server:clojure-agent-send-off-pool-0: Started @32175ms
Elapsed time: 28.050 sec
java.io.IOException: Couldn't delete C:\Users\Bill.boot\cache\tmp\Users\Bill\Documents\aatree\aademos\servant-demo\ci0\mm3x96\main.js
clojure.java.io/delete-file/invokeStatic io.clj: 434
clojure.java.io/delete-file io.clj: 430
...
boot.file/delete-file file.clj: 54
boot.tmpdir.TmpFileSet/commit! tmpdir.clj: 236
boot.core/commit! core.clj: 383
boot.task.built-in/fn/fn/fn/fn/fn/fn built_in.clj: 264
boot.task.built-in/fn/fn/fn/fn/fn built_in.clj: 264
boot.task.built-in/fn/fn/fn/fn built_in.clj: 261
boot.core/run-tasks core.clj: 794
boot.core/boot/fn core.clj: 804
clojure.core/binding-conveyor-fn/fn core.clj: 1938
...
Writing main.cljs.edn...
Compiling ClojureScript...
ò main.js
java.nio.file.FileSystemException: C:\Users\Bill.boot\cache\tmp\Users\Bill\Documents\aatree\aademos\servant-demo\ci0\mm3x96\main.js: The process cannot access the file because it is being used by another process.
file: "C:\\Users\\Bill\\.boot\\cache\\tmp\\Users\\Bill\\Documents\\aatree\\aademos\\servant-demo\\ci0\\mm3x96\\main.js"
reason: "The process cannot access the file because it is being used by another process.\r\n"
sun.nio.fs.WindowsException.translateToIOException
sun.nio.fs.WindowsException.rethrowAsIOException
sun.nio.fs.WindowsException.rethrowAsIOException
sun.nio.fs.WindowsFileSystemProvider.implDelete
sun.nio.fs.AbstractFileSystemProvider.deleteIfExists
...
boot.file/hard-link file.clj: 145
boot.tmpdir.TmpFileSet/fn tmpdir.clj: 251
boot.tmpdir.TmpFileSet/commit! tmpdir.clj: 237
boot.core/commit! core.clj: 383
adzerk.boot-cljs/eval326/fn/fn/fn boot_cljs.clj: 230
adzerk.boot-cljs/eval275/fn/fn/fn boot_cljs.clj: 135
adzerk.boot-cljs-repl/eval427/fn/fn/fn boot_cljs_repl.clj: 171
boot.task.built-in/fn/fn/fn/fn built_in.clj: 312
boot.task.built-in/fn/fn/fn/fn built_in.clj: 310
adzerk.boot-reload/eval514/fn/fn/fn/fn boot_reload.clj: 125
adzerk.boot-reload/eval514/fn/fn/fn boot_reload.clj: 124
boot.task.built-in/fn/fn/fn/fn built_in.clj: 156
boot.task.built-in/fn/fn/fn/fn/fn/fn built_in.clj: 264
boot.task.built-in/fn/fn/fn/fn/fn built_in.clj: 264
boot.task.built-in/fn/fn/fn/fn built_in.clj: 261
boot.core/run-tasks core.clj: 794
boot.core/boot/fn core.clj: 804
clojure.core/binding-conveyor-fn/fn core.clj: 1938
...
Elapsed time: 5.956 sec
from boot-reload.
I think that's probably not caused by this fix but rather by boot-clj/boot#397
As a workaround maybe you could try deleting your cache manually
from boot-reload.
@martinklepsch I had come to the same conclusion. One bug was masking another, boot-clj/boot#397
Unlike nx systems, windows does not delete read only files.
from boot-reload.
Related Issues (20)
- Warn if :asset-path is specified but does not start with /
- ERROR: Invalid token: ws://localhost:40781 (possible regression) HOT 1
- Reload files where resource path doesn't match web url path HOT 3
- Some confusion on `defrecord` on reloading HOT 1
- Reloading behaviour changes on migration to 2.7 HOT 3
- Web-worker support HOT 1
- 0.5.0 todo HOT 2
- Use of reserved Javascript keyword in adzerk.boot-reload HOT 2
- Not harmful exception at shutdown HOT 4
- Try to optimize page load time with Boot-reload
- Assert on-jsload option from .cljs.edn is a symbol HOT 1
- Closure Library deleted goog.net.jsloader.loadMany HOT 1
- document.write warnings HOT 1
- Reloads before boot-cljs has written resource HOT 27
- Closure library deleted goog.net.jsloader.load HOT 8
- java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter (Clojure 1.9 on openjdk 10.0.1 2018-04-17) HOT 5
- Update http-kit for Java 9+ support
- Reload websocket is related to assets? HOT 8
- Cljs-asset-path should end up in js file? HOT 2
- Rename :asset-path HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boot-reload.