【vue运行报错】There are multiple modules with names… 报错原因和解决办法

项目场景:

There are multiple modules with names that only differ in casing.

项目运行时候报错如下:

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. : 使用唯一的写法。


问题描述

vue运行时项目报错:

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.

原因分析:

原因:可能是你的项目文件的父组件文件使用了驼峰式起名的写法导致 报错

我是由于:

文件路径命名moduleApi;

在编辑器中自动导入引入时变成大写:

import queryList from ‘../moduleAPI/queryApi.js’

由于大小写问题导致找不到唯一的文件,重新修改导入名字就行


解决方案:

重新修改导入名字就行,命名区分大小写,唯一

import queryList from ‘../moduleAPI/queryApi.js’ 改成

import queryList from ‘../moduleApi/queryApi.js’

即:

moduleAP’ => moduleApi’

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/bc267a3684.html