vue使用vuex后报警:There are multiple modules with names that only differ in casing.

在vue项目中使用了vuex,但是项目跑起来之后控制台告警:

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:

  • F:\dch\workspace\PMS\node_modules\Vuex\dist\vuex.esm.js
    Used by 1 module(s), i. e.
    F:\dch\workspace\PMS\node_modules\babel-loader\lib\index.js!F:\dch\workspace\PMS\node_modules\eslint-loader\index.js??ref--0!F:\dch\workspace\PMS\src\store\index.js
  • F:\dch\workspace\PMS\node_modules\vuex\dist\vuex.esm.js
    Used by 9 module(s), i. e.
    F:\dch\workspace\PMS\node_modules\babel-loader\lib\index.js!F:\dch\workspace\PMS\node_modules\vue-loader\lib\selector.js?type=script&index=0!F:\dch\workspace\PMS\src\views\server.vue

这是因为在引入vuex的时候有的地方首字母大写有的地方首字母小写引起的。具体代码如下:
store/index.js引入代码如下:

import Vuex from "Vuex";

在vue文件引入vuex的代码如下:

import { mapMutations } from "vuex";

将index.js引入的vuex首字母改成小写就解除了这个告警信息

posted @ 2020-03-25 17:32  寻找石头鱼  阅读(696)  评论(0编辑  收藏  举报