[Solved] vue3vite Error: Failed to resolve import “@vue/server-renderer from “src\App.vue“. Does the file exist

Project scenario:

In the process of testing 3D effects, there was a problem with vite suddenly. I found many methods on the Internet and didn’t know where the problem was.

Problem description

This is the error code of VSC. The error code running on HBx is different from this.


Solution:

Use after downloading yarn

yarn install

After reinstalling the dependency, you can run it

I don’t know why, because NPM run serve will also fail to get after vite is packaged

npm run build
npm run serve

You can build first and then serve.

Read More: