The package reports an error
but npm run dev is running normally
After some searching, this error is more difficult to find
Pay attention to vue-tsc --noEmit in package.json and delete it
{
“name”: “vuevitec”,
“version”: “0.0.0”,
“scripts”: {
“dev”: “vite”,
“build”: “vue-tsc --noEmit && vite build”,
“preview”: “vite preview”
},
改成如下
{
“name”: “vuevitec”,
“version”: “0.0.0”,
“scripts”: {
“dev”: “vite”,
“build”: “vite build”,
“preview”: “vite preview”
},
Search what vue-tsc --noEmit does
Execute tsc --noEmit, TSC will read the configuration file to obtain parameter values, the function of --noEmit is to only check, not to compile and output. If our code is error-free, it will exit directly, otherwise it will report an error.