Dva: 删除model之后报错

Created on 8 Feb 2017  ·  13Comments  ·  Source: dvajs/dva

当删除一个已经创建的model时,dva会一直报找不到对应model的错误。
确认所有对此model的引用都已经删除。

faq question

Most helpful comment

尝试执行 rm -r node_modules/.cache/babel-loader 再执行 npm start 错误消失,大家可以尝试下

All 13 comments

Error in ./src/index.js
Module not found: [CaseSensitivePathsPlugin] `/Users/Grea/Workspace/grea/kuaidi-ui/src/models/post.js` does not match the corresponding path on disk - File does not exist.

src/index.js 是否有引用? 重启 npm start 是否还有报错?

一切都正常,npm也重启了很多次

+1

还没解决? 打个包发出来我看看。

@sorrycc 通过dva g model test的,手动将这个models/test.js文件删除掉,会报这个错。

@kairi1227 还要在 index.js 里删除对于 model 的引用。

尝试执行 rm -r node_modules/.cache/babel-loader 再执行 npm start 错误消失,大家可以尝试下

手动点赞!

@wutaizeng 感谢!

@wutaizeng b( ̄▽ ̄)d,感觉npm的这个bug太蛋疼了

rm -r node_modules/.cache/babel-loader 这个执行是什么意思? 重命名了一下models就一直报错了 window系统下

rm -r node_modules/.cache/babel-loader 这个执行是什么意思?

这是 babel-loader 的缓存目录。

Was this page helpful?
0 / 5 - 0 ratings