After vue3+vite installs vite-plugin-mock, it reports an error
Introduce error reporting in vite.config.ts
viteMockServe({ localEnabled: command === 'serve', }),
Reported an error after adding in vite.config.ts
run error
Then execute the run command to report an error
Solution
It is related to the version of vite-plugin-mock. After I installed version 2.9.6, no error will be reported. Execute the command as follows
yarn add mockjs vite-plugin-mock@2.9.6 -D