Giter VIP home page Giter VIP logo

Comments (8)

laforge49 avatar laforge49 commented on May 27, 2024

A fix would likely be to check to see if window is defined, as it is not in webworkers.

from boot-reload.

martinklepsch avatar martinklepsch commented on May 27, 2024

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.

laforge49 avatar laforge49 commented on May 27, 2024

Couldn't say, but I suspect not. But then I'm really surprised that reloading is possible at all.

from boot-reload.

laforge49 avatar laforge49 commented on May 27, 2024

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.

laforge49 avatar laforge49 commented on May 27, 2024

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.

laforge49 avatar laforge49 commented on May 27, 2024

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.

martinklepsch avatar martinklepsch commented on May 27, 2024

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.

laforge49 avatar laforge49 commented on May 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.