vite-plugin-vue icon indicating copy to clipboard operation
vite-plugin-vue copied to clipboard

创建多个 vite server 进行ssr服务端渲染时会报错

Open sapphi-red opened this issue 3 years ago • 2 comments

Discussed in https://github.com/vitejs/vite/discussions/10567

Originally posted by yuntian001 October 21, 2022

Describe the bug

当我用官方的vue ssr demo,改为多个createServer ,不同url路由走不同的server ssr渲染逻辑时会报如下错误,但是页面可以正常展示。

 [vite] Internal server error: ENOENT: no such file or directory, open '/test2/src/pages/Home.vue'
      at Object.openSync (node:fs:585:3)
      at Object.readFileSync (node:fs:453:35)
      at getDescriptor (file:///D:/my/vite-vue-ssr/node_modules/@vitejs/plugin-vue/dist/index.mjs:86:10)
      at Context.load (file:///D:/my/vite-vue-ssr/node_modules/@vitejs/plugin-vue/dist/index.mjs:2613:28)
      at Object.load (file:///D:/my/vite-vue-ssr/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:41084:46)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

Reproduction

https://github.com/yuntian001/vite-vue-ssr

Steps to reproduce

  • yarn install
  • yarn run dev
  • 访问 http://localhost:6173/test2/

System Info

System:
    OS: Windows 10 10.0.17763
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 6.44 GB / 15.86 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.13.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Internet Explorer: 11.0.17763.771

Used Package Manager

yarn

Logs

No response

Validations

sapphi-red avatar Oct 21 '22 05:10 sapphi-red

The reproduction seems valid.

1.yarn install
2.yarn run dev
3.访问 http://localhost:6173/test2/

There's nothing on the page.

edison1105 avatar Sep 25 '24 02:09 edison1105

It doesn't reproduce on stackblitz. But it reproduces on my local Windows machine.

sapphi-red avatar Sep 25 '24 02:09 sapphi-red