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

[Bug]: Module not found: Can't resolve 'virtual-site-data' in ".rspress" #1423

Open
ClearLuvMoki opened this issue Sep 18, 2024 · 3 comments
Labels
🐞 bug Something isn't working

Comments

@ClearLuvMoki
Copy link

版本信息

System:
    OS: macOS 14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 31.30 MB / 16.00 GB
    Shell: 3.2.57 - /bin/sh
  Browsers:
    Chrome: 129.0.6668.58
    Safari: 17.5
  npmPackages:
    rspress: ^1.31.0 => 1.31.0

问题详情

当运行时以及启动时无任何报错,但是当运行过半分钟ws出现该报错,因为是VSCode本地启动存在报错,codepen无法复现
image

复现链接

http://localhost:3000

复现步骤

暂不清楚为何出现该报错

@ClearLuvMoki ClearLuvMoki added the 🐞 bug Something isn't working label Sep 18, 2024
@SoonIter SoonIter changed the title [Bug]: 运行时 出现该问题 [Bug]: Module not found: Can't resolve 'virtual-site-data' in ".rspress" Sep 19, 2024
@SoonIter
Copy link
Member

Rspress 使用了虚拟模块,在 node_modules/.rspress 会生成临时文件 'virtual-site-data' 等,所以同一时间只能起一个 dev 进程

web-infra-dev/rspack#7478 后会重构 https://github.com/rspack-contrib/rspack-plugin-virtual-module, 相关报错会减少

Rspress uses virtual modules, and temporary files 'virtual-site-data' will be generated in node_modules/.rspress, so only one dev process can be started at a time.

after web-infra-dev/rspack#7478 will refactor https://github.com/rspack-contrib/rspack- Plugin-virtual-module, related errors will be reduced

@ClearLuvMoki
Copy link
Author

ClearLuvMoki commented Sep 20, 2024

目前这个问题计划多久修复呢,我确定每次只是启动一个了服务,目前使用看起来隔一会就需要重启一下,但是我看了issues大家好像并没有出现相同的问题
此外,我发现修改_meta.json重启的时间太慢了,我kill服务手动重启都比这快

@Timeless0911
Copy link
Collaborator

Timeless0911 commented Sep 20, 2024

这个问题通常只会发生在有多个未关闭的 dev 进程时,如果你重启慢,那么如果只通过一次 ctrl+ C 来退出也会是一样的慢,他们调用的 shut down 和 restart 逻辑是相同的。你说的 kill 服务手动重启应该是通过连续 ctrl+ C 强制终端退出的,那么就会出现进程没有完全杀死,可能有多个 dev server 同时存在的情况。

建议可以先配置一个

builderConfig: {
    tools: {
      rspack: {
        watchOptions: {
          ignored: /node_modules/,
        },
      },
    },
  },

尝试去忽略 node_modules 目录下的文件监听,里面可能有过大的文件,比如 antd 这样的库,导致 watchpack 关闭时间过长,进而引起重启慢的问题。

另外,此类问题建议提供可以复现的仓库,口头描述无法定位问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants