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

The CJS build of Vite's Node API is deprecated #129

Open
VfanLee opened this issue Feb 4, 2024 · 1 comment
Open

The CJS build of Vite's Node API is deprecated #129

VfanLee opened this issue Feb 4, 2024 · 1 comment

Comments

@VfanLee
Copy link

VfanLee commented Feb 4, 2024

我将项目从 vite 4 升级到了 vite 5,也按照官方更改了我的项目:

  1. vite.config.js 全部改为 ESM 语法
  2. package.json 添加 "type": "module"

运行项目后,仍然提示:
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

经过排查,发现问题出现在 vite-plugin-mock 上。

虽然不影响功能,但是还是想消除警告,请问该如何解决?

@kortin99
Copy link

kortin99 commented Feb 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants