2043242294
2043242294
  • 发布:2023-06-13 14:14
  • 更新:2023-10-08 20:15
  • 阅读:959

【报Bug】HbuildX 运行到小程序会经常出现 Error: EBUSY: resource busy or locked, lstat 'E:\pagefile.sys' 然后中断热更新编译!!

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 10

第三方开发者工具版本号: 1.06.2303220

基础库版本号: 2.19.2

项目创建方式: CLI

CLI版本号: 2.9.5

操作步骤:

使用cli构建项目,运行到微信小程序,等待一会就会出现

预期结果:

不会出现此错误代码,不中断热更新编译

实际结果:

出现此错误代码,中断热更新编译

bug描述:

HbuildX 运行到小程序会经常出现 Error: EBUSY: resource busy or locked, lstat 'E:\pagefile.sys' 然后中断热更新编译
重启之后只有一会是正常的,过一会就会出现(然后中短热更新):
node:events:498
14:12:12.668 throw er; // Unhandled 'error' event
14:12:12.675 ^
14:12:12.675 Error: EBUSY: resource busy or locked, lstat 'E:\pagefile.sys'
14:12:12.681 Emitted 'error' event on FSWatcher instance at:
14:12:12.682 at FSWatcher._handleError (E:\code\云牛\yxyx-mini-butler\node_modules\rollup\dist\shared\index.js:4235:10)
14:12:12.688 at ReaddirpStream.NodeFsHandler$1._boundHandleError (E:\code\云牛\yxyx-mini-butler\node_modules\rollup\dist\shared\index.js:2711:43)
14:12:12.690 at ReaddirpStream.emit (node:events:520:28)
14:12:12.696 at emitErrorNT (node:internal/streams/destroy:157:8)
14:12:12.697 at emitErrorCloseNT (node:internal/streams/destroy:122:3)
14:12:12.704 at processTicksAndRejections (node:internal/process/task_queues:83:21) {
14:12:12.704 errno: -4082,
14:12:12.713 code: 'EBUSY',
14:12:12.713 syscall: 'lstat',
14:12:12.720 path: 'E:\pagefile.sys'
14:12:12.721 }

2023-06-13 14:14 负责人:无 分享
已邀请:

最佳回复

DCloud_UNI_LXH

DCloud_UNI_LXH

vite.config.js 中添加以下代码:

defineConfig({  
  // ...  
  build: {  
        watch: {  
            exclude: ['node_modules/**', "/__uno.css"]  
        },  
    }  
})

重新运行项目试试看

c***@163.com

c***@163.com

相同问题, 希望官方加快修复

DCloud_UNI_LXH

DCloud_UNI_LXH

你是否使用了 unocss?

https://github.com/vitejs/vite/issues/13234

  • 2043242294 (作者)

    是的,项目中使用了unocss

    2023-06-30 14:18

  • coderPeng

    回复 2043242294: 你解决了吗?

    2023-07-03 11:37

  • 2043242294 (作者)

    回复 coderPeng: 依然没有

    2023-07-04 11:07

  • DCloud_UNI_LXH

    回复 2043242294: 目前看来 vite 和 unocss 一起使用会有这个问题,看 vite 后续是否会修复此问题

    2023-07-04 11:14

  • 2043242294 (作者)

    可以麻烦重点看一下么,这个错误非常影响开发效率,不能每次都重启微信开发工具吧

    2023-07-04 11:14

  • coderPeng

    回复 DCloud_UNI_LXH: 官方大大,这个问题很多人遇到啦,一直无法解决呀

    2023-07-04 16:52

  • DCloud_UNI_LXH

    回复 coderPeng:

    vite.config.js 中添加以下代码:


    defineConfig({  
    // ...
    build: {
    watch: {
    exclude: ['node_modules/**', "/__uno.css"]
    },
    }
    })

    重新运行项目试试看

    2023-07-05 12:08

  • 2043242294 (作者)

    回复 DCloud_UNI_LXH: 感谢!!问题解决了,不会中断了

    2023-07-05 17:06

coderPeng

coderPeng

同样的问题出现在cli创建的vue3-ts-uniapp-unocss项目,vscode运行微信开发者工具的命令,过一会就报错,无法热更新了

y***@outlook.com

y***@outlook.com

同故障,但是没有用unocss

要回复问题请先登录注册