显示已包含的文件名,当在React中导入文件时。

huangapple go评论66阅读模式
英文:

Show Already included file name, when import a file in react

问题

My program runs very well but VSCode gives this error. Any solution?
显示已包含的文件名,当在React中导入文件时。

我正在导入 HeaderFooter;它们位于布局文件夹目录的根目录。但它显示:

> 已包含的文件名
> 'd:/Work/gunox/src/components/layout/Footer.js' 与文件名
> 'd:/Work/gunox/src/components/Layout/Footer.js' 仅在大小写上不同。该
> 文件位于程序中,因为:
> 从文件 'd:/Work/gunox/src/components/layout/Layout.js' 导入 "./Footer"
> 指定为编译的根文件ts(1261)

英文:

My program runs very well but VSCode gives this error. Any solution?
显示已包含的文件名,当在React中导入文件时。

I am importing Header or Footer; these are located in root of layout folder directory. But it show:

> Already included file name
> 'd:/Work/gunox/src/components/layout/Footer.js' differs from file name
> 'd:/Work/gunox/src/components/Layout/Footer.js' only in casing. The
> file is in the program because:
> Imported via "./Footer" from file 'd:/Work/gunox/src/components/layout/Layout.js'
> Root file specified for compilationts(1261)

答案1

得分: 0

无法确定确切的错误,但看起来你在与另一个名为 layout 的文件夹位于同一文件夹中有一个名为 Layout 的文件夹(即它们仅在大小写字母 "L" 上有区别)。我建议在构建软件时一般情况下都要避免这种情况,并且永远不要这样做,因为它只会引起问题,而不会带来任何好处。

英文:

Can't speak to the exact error, but it looks like you have a folder called Layout in the same folder as another folder called layout (ie, they differ only in the capital or lowercase "L"). I'd recommend avoiding this in general and forever when you're building software - it's only going to cause problems and never add any benefit.

huangapple
  • 本文由 发表于 2023年5月20日 22:51:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76295823.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定