英文:
Show Already included file name, when import a file in react
问题
My program runs very well but VSCode gives this error. Any solution?
我正在导入 Header
或 Footer
;它们位于布局文件夹目录的根目录。但它显示:
> 已包含的文件名
> '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?
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论