雲端運算平台和基礎結構,可透過 Microsoft 管理的資料中心全球網路來建置、部署和管理應用程式與服務。
如何解決Static Web App問題
我將前端透過 GitLab 部署到 Azure 上,
(I deployed the frontend to Azure through GitLab.)
部署成功之後,訪問前端網址:https://????????????????.azurestaticapps.net,
(After a successful deployment, I accessed the frontend URL: https://????????????????.azurestaticapps.net)
結果 Console 出現錯誤:
(The console showed an error:)
Refused to apply style from 'https://????????????????.azurestaticapps.net/css/app.f07feabe.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.Understand this error
Refused to apply style from 'https://????????????????.azurestaticapps.net/css/chunk-vendors.b029c8dc.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.Understand this error
Refused to execute script from 'https://????????????????.azurestaticapps.net/js/app.51a496a1.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.Understand this error
Refused to execute script from 'https://????????????????.azurestaticapps.net/js/chunk-vendors.f318a04e.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.Understand this error
Refused to apply style from 'https://????????????????.azurestaticapps.net/css/chunk-vendors.b029c8dc.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.Understand this error
Refused to apply style from 'https://????????????????.azurestaticapps.net/css/app.f07feabe.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.Understand this error
附上我的 staticwebapp.config.json:
(There is my staticwebapp.config.json)
{
"platform": {},
"routes": [
{
"route": "/api/*",
"rewrite": "https://
},
{
"route": "/*",
"rewrite": "/index.html"
}
],
"navigationFallback": {
"rewrite": "/index.html",
"exclude": ["/api/*", "/css/*", "/js/*", "/favicon.ico"]
}
}