错误:防止写入与已写入文件相比只有大小写或查询字符串不同的文件。reactjs Laravel

7

我正在开发一个laravel reactjs项目,在运行命令npm run dev时,编译进度在95%时卡住并显示以下错误。我检查了整个项目,没有任何调用大小写敏感名称的文件,所有图片都使用小写字母调用。

Error: Prevent writing to file that only differs in casing or query string from already written file.
This will lead to a race-condition and corrupted files on case-insensitive file systems.
/media/public/images/user-4.jpg
/media/public/images/user-4.jpg

React版本:17.0.1

Webpack版本:5.21.2

Node版本:14.15.2


请查看此链接 https://github.com/microsoft/TypeScript/issues/25460#issuecomment-526273944 ,也许您有类似的问题。 - Emanuele Scarabattoli
我也尝试了同样的方法,但对我没有起作用。 - Varinder Sohal
如果可能的话,请与我们分享webpack文件。 - Vipertecpro
3个回答

2

我遇到了同样的问题,使用小写字母后问题得以解决。


1
你能提供解决方案的示例吗? - C Alonso C Ortega

1

我遇到了类似的错误。解决方法如下:

/media/public/images/user-4.jpg
/media/public/images/user-4.jpg

重写

[name]user-4.jpg

我认为你的问题是路径。


2
请使用StackOverflow编辑器提供的文本格式选项,以改善您的答案的可读性。 - Pawara Siriwardhane

0
在我的情况下,我在webpack.config.js中有两个入口点,并错误地没有修改第二个入口点。
所以进行更改。
entry: { main: './src/index.tsx', another: './src/index.tsx' }

entry: { main: './src/index.tsx', another: './src/someOtherIndex.tsx' }

修复了错误


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接