Closed songyipan closed 9 months ago
我也遇到了,但是发现github上最新的版本是2.9.1,安装2.9.1就行了
删除自己项目根目录下 package.json
中的 这一行,一般默认会有
"type": "module"
声明type:"module", 默认会读取 dist/index.mjs ,删除之后会读取 dist/index.cjs
环境
"vite": "^4.4.9",
"vite-plugin-mock": "^3.0.0"
"node":"v16.14.0"
将代码这样改: 不然运行时会报: