简体   繁体   English

aws amplify react 部署抛出清单语法错误

[英]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:这里有几个问题:

  1. 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.不确定构建在这里意味着什么。

  2. 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:这对我有用:

  1. Open Amplify console打开 Amplify 控制台

  2. 'App settings' > 'Rewrites and redirects', click 'edit' “应用程序设置”>“重写和重定向”,点击“编辑”

  3. click 'Open text editor'点击“打开文本编辑器”

  4. 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.

相关问题 AWS Amplify React GET 请求错误 - 缺少身份验证令牌 - AWS Amplify React GET request error - missing authentication token 错误“无法解析模块 aws-amplify-react-native” - Error "Unable to resolve module aws-amplify-react-native" 无法在 AWS amplify 上部署 Next Js SSR 应用程序。 (网站内部错误和部署在 cli 上失败) - Unable to Deploy Next Js SSR app on AWS amplify. ( Internal error on Website and Deployment failed on cli) 使用 Github 进行基于 AWS Amplify 标签的部署 - AWS Amplify tag based deployment using Github 获取在 AWS amplify 上构建和部署的状态 - Get status of building and deployment on AWS amplify AWS Amplify 错误从 aws-amplify 导入 StorageProvider 类 - AWS Amplify error import StorageProvider class from aws-amplify 将 React 应用程序部署到 aws amplify 后,react.production.min.js 发生错误 - Error occured in react.production.min.js after deploying react app to the aws amplify AWS 'Amplify push' 命令在 React Native 项目中给出 'file already exists in amplify/.temp/#current-cloud-backend' 错误 - AWS 'Amplify push' command giving 'file already exists in amplify/.temp/#current-cloud-backend' error in React Native project AuthError - 错误:未正确配置 Amplify / AWS cognito,React JS - AuthError - Error: Amplify has not been configured correctly / AWS cognito, React JS 在 AWS Amplify 上构建 React 应用程序在 Amplify 控制台中失败 - Build of React application on AWS Amplify fails in Amplify Console
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM