vue-cli webpack 热加载失效

npm run dev 刚启动时正常
然后一改动所有样式都失效了
我把项目删了 重新clone 下来 再跑 又正常了 然后过会又是这种

浏览器里的报错

[HMR] bundle has 4 warnings
client.js?8547:161 ../foudaoH5/~/.npminstall/vue-loader/11.1.3/vue-loader/lib/component-normalizer.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\foudaoH5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\component-normalizer.js
    Used by 1 module(s), i. e.
    D:\foudaoh5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\index.js??ref--0!D:\foudaoH5\src\components\Home\Home.vue
* D:\foudaoh5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\component-normalizer.js
    Used by 1 module(s), i. e.
    D:\foudaoh5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\index.js??ref--0!D:\foudaoh5\src\App.vue
../foudaoH5/~/.npminstall/vue-style-loader/2.0.3/vue-style-loader/lib/addStylesClient.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\foudaoH5\node_modules\.npminstall\vue-style-loader\2.0.3\vue-style-loader\lib\addStylesClient.js
    Used by 1 module(s), i. e.
    D:\foudaoh5\node_modules\.npminstall\vue-style-loader\2.0.3\vue-style-loader\index.js!D:\foudaoh5\node_modules\.npminstall\css-loader\0.26.2\css-loader\index.js?{"minimize":false,"sourceMap":false}!D:\foudaoH5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\style-rewriter.js?{"id":"data-v-be959d02","scoped":true,"hasInlineConfig":true}!D:\foudaoh5\node_modules\.npminstall\sass-loader\6.0.2\sass-loader\lib\loader.js?{"sourceMap":false}!D:\foudaoH5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\selector.js?type=styles&index=0!D:\foudaoH5\src\components\Home\Home.vue
* D:\foudaoh5\node_modules\.npminstall\vue-style-loader\2.0.3\vue-style-loader\lib\addStylesClient.js
    Used by 1 module(s), i. e.
    D:\foudaoh5\node_modules\.npminstall\vue-style-loader\2.0.3\vue-style-loader\index.js!D:\foudaoh5\node_modules\.npminstall\css-loader\0.26.2\css-loader\index.js?{"minimize":false,"sourceMap":false}!D:\foudaoh5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\style-rewriter.js?{"id":"data-v-aeb59330","scoped":false,"hasInlineConfig":true}!D:\foudaoh5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\selector.js?type=styles&index=0!D:\foudaoh5\src\App.vue
../foudaoH5/~/.npminstall/css-loader/0.26.2/css-loader/lib/css-base.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\foudaoH5\node_modules\.npminstall\css-loader\0.26.2\css-loader\lib\css-base.js
    Used by 1 module(s), i. e.
    D:\foudaoH5\node_modules\.npminstall\css-loader\0.26.2\css-loader\index.js?{"minimize":false,"sourceMap":false}!D:\foudaoH5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\style-rewriter.js?{"id":"data-v-be959d02","scoped":true,"hasInlineConfig":true}!D:\foudaoH5\node_modules\.npminstall\sass-loader\6.0.2\sass-loader\lib\loader.js?{"sourceMap":false}!D:\foudaoH5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\selector.js?type=styles&index=0!D:\foudaoH5\src\components\Home\Home.vue
* D:\foudaoh5\node_modules\.npminstall\css-loader\0.26.2\css-loader\lib\css-base.js
    Used by 1 module(s), i. e.
    D:\foudaoh5\node_modules\.npminstall\css-loader\0.26.2\css-loader\index.js?{"minimize":false,"sourceMap":false}!D:\foudaoh5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\style-rewriter.js?{"id":"data-v-aeb59330","scoped":false,"hasInlineConfig":true}!D:\foudaoh5\node_modules\.npminstall\vue-loader\11.1.3\vue-loader\lib\selector.js?type=styles&index=0!D:\foudaoh5\src\App.vue
../foudaoH5/~/.npminstall/vue-style-loader/2.0.3/vue-style-loader/lib/listToStyles.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\foudaoH5\node_modules\.npminstall\vue-style-loader\2.0.3\vue-style-loader\lib\listToStyles.js
    Used by 1 module(s), i. e.
    D:\foudaoH5\node_modules\.npminstall\vue-style-loader\2.0.3\vue-style-loader\lib\addStylesClient.js
* D:\foudaoh5\node_modules\.npminstall\vue-style-loader\2.0.3\vue-style-loader\lib\listToStyles.js
    Used by 1 module(s), i. e.
    D:\foudaoh5\node_modules\.npminstall\vue-style-loader\2.0.3\vue-style-loader\lib\addStylesClient.js
    
    项目里就一个模块 `components/Home/Home`
    
    

clipboard.png

看警告好像是模块重名了 可是我就一个模块啊 怎么会重名的

阅读 10.7k
4 个回答
新手上路,请多包涵

我也碰到这个问题了 不能热更新 求解答

哎,热加载就是坑。 现在我除了调css用热加载。其他时候都用webpack watch.

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进