[英]ENOENT error when serving React App on Azure
I have a React website hosted on Azure and successfully serving up pages without a problem.我有一个托管在 Azure 上的 React 网站,并且成功地提供了页面而没有问题。
However, I often get error messages in the Web App logs such as:但是,我经常在 Web App 日志中收到错误消息,例如:
2021-03-01T15:01:33.957751902Z 15:01:33 0|static-page-server-8080 | [2021-03-01T15:01:33.956Z]
Error while serving /home/site/wwwroot/build/profile with content-type text/plain :
ENOENT: no such file or directory, open '/home/site/wwwroot/build/profile'
This error, for example, occurs when I navigate to: https://www.webaddress.com/account/profile例如,当我导航到以下位置时会发生此错误: https://www.webaddress.com/account/profile
To be clear the pages are still served without a problem.需要明确的是,仍然可以毫无问题地提供页面。 So why am I receiving this error?
那么为什么我会收到此错误? And how can I stop it?
我该如何阻止它?
First, validate the distribution folder and check the file index.html, the labels have to be like this首先,验证分发文件夹并检查文件索引。html,标签必须是这样的
<base href="/">
and you "outputPath" have to be like this "dist",而你的“outputPath”必须是这样的“dist”,
"outputPath": "dist",
Best regards此致
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.