Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev server constantly crashing with "Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'" #1106

Open
5 tasks done
mklueh opened this issue Oct 22, 2024 · 7 comments · May be fixed by unocss/unocss#4406 or #1365
Open
5 tasks done
Labels
needs-reproduction The issue doesn't include a minimal reproduction for maintainers to use to solve the issue.

Comments

@mklueh
Copy link

mklueh commented Oct 22, 2024

Describe the bug

I have the feeling that this happens after a while when a few reloads have happened, and I'm not sure if it is even related to this library, as I'm facing the same with Nuxt as well. Might be Vite related, but maybe sb has the same problem and has found a workaround.


WXT 0.19.13
✔ Started dev server @ http://localhost:3001
ℹ Pre-rendering chrome-mv3 for development with Vite 5.4.9
- Preparing...
✔ Built extension in 5.507 s
  ├─ .output\chrome-mv3\manifest.json                1.37 kB
  ├─ .output\chrome-mv3\popup.html                   636 B
  ├─ .output\chrome-mv3\background.js                89.43 kB
  ├─ .output\chrome-mv3\chunks\popup-CMB-8dTp.js     3.1 kB
  ├─ .output\chrome-mv3\content-scripts\content.js   701.24 kB
  ├─ .output\chrome-mv3\content-scripts\content.css  2.36 kB
  ├─ .output\chrome-mv3\icon\128.png                 3.07 kB
  ├─ .output\chrome-mv3\icon\16.png                  559 B
  ├─ .output\chrome-mv3\icon\32.png                  916 B
  ├─ .output\chrome-mv3\icon\48.png                  1.33 kB
  ├─ .output\chrome-mv3\icon\96.png                  2.37 kB
  └─ .output\chrome-mv3\wxt.svg                      1.07 kB
Σ Total size: 807.45 kB
node:events:497
      throw er; // Unhandled 'error' event
      ^
Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (file:///C:/Users/MyPC/Workspace/my-project/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:44469:10)
    at ReaddirpStream.NodeFsHandler._boundHandleError (file:///C:/Users/MyPC/Workspace/my-project/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:42942:43)
    at ReaddirpStream.emit (node:events:519:28)
    at ReaddirpStream.emit (node:domain:488:12)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -4082,
  code: 'EBUSY',
  syscall: 'lstat',
  path: 'C:\\DumpStack.log.tmp'
}
Node.js v22.9.0

Reproduction

Not sure, but I have this with Nuxt too, but not with my express server

Steps to reproduce

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 1.95 GB / 15.77 GB
  Binaries:
    Node: 22.9.0 - ~\AppData\Local\Volta\tools\image\node\22.9.0\node.EXE
    Yarn: 4.5.1 - ~\AppData\Local\Volta\tools\image\yarn\4.5.1\bin\yarn.CMD
    npm: 10.8.3 - ~\AppData\Local\Volta\tools\image\node\22.9.0\npm.CMD
  Browsers:
    Chrome: 130.0.6723.59
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    vite: 5.4.9 => 5.4.9 
    wxt: 0.19.13 => 0.19.13

Used Package Manager

yarn

Validations

@mklueh mklueh added the pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug label Oct 22, 2024
@1natsu172
Copy link
Contributor

@mklueh I think you should submit a minimal reproduction. Can you submit it?

@aklinker1 aklinker1 added needs-reproduction The issue doesn't include a minimal reproduction for maintainers to use to solve the issue. and removed pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug labels Oct 23, 2024
@aklinker1
Copy link
Collaborator

If it's happening with Nuxt, it's probably related to a dependency we share... Maybe Chokidar? What versions of chokidar are listed in your lockfile?

@mklueh
Copy link
Author

mklueh commented Oct 24, 2024

Good point. I was on chokidar 3.6.0 before, and now I've enforced 4.0.1 but facing the same problem

@mklueh
Copy link
Author

mklueh commented Dec 5, 2024

Haven't faced it with Nuxt anymore for a while now, but the Wxt issue remains. Are you guys developing on Windows?

@aklinker1
Copy link
Collaborator

I don't have a windows machine. Did Nuxt have an issue for this that got closed that we can reference?

@shaohan0228
Copy link

i developed on windows 11, my package.json

{
  "name": "@downloader/plugin",
  "private": true,
  "version": "0.1.0",
  "type": "module",
  "scripts": {
    "dev": "wxt",
    "dev:firefox": "wxt -b firefox",
    "build": "wxt build",
    "build:firefox": "wxt build -b firefox",
    "zip": "wxt zip",
    "zip:firefox": "wxt zip -b firefox",
    "compile": "vue-tsc --noEmit",
    "clean": "rimraf dist",
    "postinstall": "wxt prepare"
  },
  "dependencies": {
    "@types/chrome": "^0.0.268",
    "pinia": "^2.3.0",
    "vue": "^3.5.13"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^5.2.1",
    "axios": "^1.7.9",
    "rimraf": "^5.0.10",
    "sass": "^1.83.0",
    "typescript": "^5.7.2",
    "unocss": "^0.60.4",
    "unplugin-icons": "^0.22.0",
    "vite": "^5.4.11",
    "vite-plugin-vue-devtools": "^7.6.8",
    "vue-tsc": "^1.8.27",
    "wxt": "^0.17.12"
  }
}

This is my project structure. In the entrypoints, only content is the code I actually developed. When I modify the code in content/App.vue, this issue almost always occurs, but I can't determine the exact timing or cause.

image

@shaohan0228
Copy link

i developed on windows 11, my package.json

{
  "name": "@downloader/plugin",
  "private": true,
  "version": "0.1.0",
  "type": "module",
  "scripts": {
    "dev": "wxt",
    "dev:firefox": "wxt -b firefox",
    "build": "wxt build",
    "build:firefox": "wxt build -b firefox",
    "zip": "wxt zip",
    "zip:firefox": "wxt zip -b firefox",
    "compile": "vue-tsc --noEmit",
    "clean": "rimraf dist",
    "postinstall": "wxt prepare"
  },
  "dependencies": {
    "@types/chrome": "^0.0.268",
    "pinia": "^2.3.0",
    "vue": "^3.5.13"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^5.2.1",
    "axios": "^1.7.9",
    "rimraf": "^5.0.10",
    "sass": "^1.83.0",
    "typescript": "^5.7.2",
    "unocss": "^0.60.4",
    "unplugin-icons": "^0.22.0",
    "vite": "^5.4.11",
    "vite-plugin-vue-devtools": "^7.6.8",
    "vue-tsc": "^1.8.27",
    "wxt": "^0.17.12"
  }
}

This is my project structure. In the entrypoints, only content is the code I actually developed. When I modify the code in content/App.vue, this issue almost always occurs, but I can't determine the exact timing or cause.

image


In my project, I suspect the issue might be related to Unocss, but the root cause could involve Vite or some deeper underlying mechanisms.

Here are relevant issues that provide some temporary solutions:

Temporary Solutions for Reference

  1. Switch from Unocss to TailwindCSS.
    I tested several projects based on WXT, Vite, and Unocss that I found on GitHub. All of them eventually triggered this issue after running for some time on my machine. However, when I switched from Unocss to TailwindCSS, the issue did not reappear.

  2. Identify the error-causing code and skip the related errors.

_handleError(error) {
  const code = error && error.code;
  if (error && code !== 'ENOENT' && code !== 'ENOTDIR' &&
    (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))
  ) {
    const filePath = 'C:\\DumpStack.log.tmp';
    if (error.code === "EBUSY" && error.path === filePath) {
        return error;
    }
    this.emit(EV_ERROR, error);
  }
  return error || this.closed;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-reproduction The issue doesn't include a minimal reproduction for maintainers to use to solve the issue.
Projects
None yet
4 participants