[英]aws amplify react deployment throwing manifest syntax error
I am having issues after deploying React application using AWS amplify.使用 AWS amplify 部署 React 应用程序后我遇到了问题。 Couple of issues here:这里有几个问题:
I see that there was a reference to %PUBLIC_URL% in the public/index.html.我看到 public/index.html 中有对 %PUBLIC_URL% 的引用。 In the documentation, it says %PUBLIC_URL% will get replaced with the URL of the public
folder during the build.在文档中,它说 %PUBLIC_URL% 将在构建期间被public
的 URL 替换。 It doesnt seem to be happening.它似乎没有发生。 Not sure what build means here.不确定构建在这里意味着什么。
I replaced %PUBLIC_URL% with /.我用 / 替换了 %PUBLIC_URL%。 I seem to be getting Manifest: Line: 1, column: 1, Syntax error.
我似乎收到Manifest: Line: 1, column: 1, Syntax error.
I tried adding crossorigin="use-credentials"
as suggested in one of the forums, but that doesnt seem to have any effect.我尝试按照其中一个论坛的建议添加crossorigin="use-credentials"
,但这似乎没有任何效果。
I have sifted through reference to this error and none seem to be pointing to the solution.我已经筛选了对这个错误的引用,但似乎没有人指出解决方案。
Appreciate any pointers.感谢任何指针。
S小号
I ran into the same issue.我遇到了同样的问题。 This worked for me:这对我有用:
Open Amplify console打开 Amplify 控制台
'App settings' > 'Rewrites and redirects', click 'edit' “应用程序设置”>“重写和重定向”,点击“编辑”
click 'Open text editor'点击“打开文本编辑器”
paste this:粘贴这个:
[ {"source": "/manifest.json", "target": "/manifest.json", "status": "200", "condition": null }, { "source": "</^((?..(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$),)*$/>": "target". "/index,html": "status", "200": "condition": null } ]
Note: the redirect of the manifest MUST be before the index.html注意:清单的重定向必须在 index.html 之前
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.