trunk icon indicating copy to clipboard operation
trunk copied to clipboard

[windows] `trunk serve` and `trunk watch` lead to `os error 32` after file change.

Open RomanRiesen opened this issue 2 years ago • 0 comments

This is the relevant part of the output:

warning: Error finalizing incremental compilation session directory `\\?\C:\Users\User\foo\target\wasm32-unknown- 
unknown\debug\incremental\web-1gx3oyd8ybik9\s-g3fli3orm0-jwbg4z-working`: The process cannot access the file because 
it is being used by another process. (os error 32)
Oct 19 14:49:43.473  INFO processing WASM
Oct 19 14:49:43.522  INFO calling wasm-bindgen
Oct 19 14:49:43.697  INFO copying generated wasm-bindgen artifacts
Oct 19 14:49:43.713  INFO applying new distribution
Oct 19 14:49:43.717 ERROR ❌ error
error applying built distribution
Caused by:
0: error moving "\\\\?\\C:\\Users\\User\\foo\\dist\\.stage\\assets" to "\\\\?\\C:\\Users\\User\\foo\\dist\\assets"
1: The process cannot access the file because it is being used by another process. (os error 32)
Oct 19 14:49:43.725  INFO 📡 serving static assets at -> /
Oct 19 14:49:43.727  INFO 📡 server listening at 0.0.0.0:8080

Removing the dist directory sometimes (?) helps.

I have made triple sure that really nothing else has any file in that directory open. This error happens on a freshly restarted system. Am I the only one with this issue?

Also, the last part of the output is a lie; the server does not start.

Rust version:

rustc 1.57.0-nightly (f03eb6bef 2021-10-02)

The index.html file used in the main directory:

<!DOCTYPE html>
<html lang="en">
  <head>
    <base data-trunk-public-url/>
    <meta charset="utf-8" />
  </head>

  <body>
  <link data-trunk rel="copy-file" href="js/draw_api.mjs"/>
  <link data-trunk defer rel="rust" href="Cargo.toml" data-wasm-opt="z" data-bin="web"/>
  <!--assets should be loaded via trunk as well-->
  <link data-trunk rel="copy-dir" href="assets"/>
  </body>
</html>

RomanRiesen avatar Oct 19 '21 13:10 RomanRiesen