简体   繁体   English

部署到 GitHub 的 React 应用程序给了我一个缩小的错误 #152

[英]React app deployed to GitHub giving me a minified error #152

I am having a problem with my React application.我的 React 应用程序有问题。 I am trying to deploy the website to GitHub pages but I am getting this error:我正在尝试将网站部署到 GitHub 页面,但出现此错误:

Error: "Minified React error #152; visit https://reactjs.org/docs/error-decoder.html?invariant=152&args[]=u for the full message or use the non-minified dev environment for full errors and additional helpful warnings."

The error is telling me to use the non-minified development environment, but I cannot figure out how to do this.错误告诉我使用非缩小的开发环境,但我不知道如何做到这一点。

Here is a link to my GitHub repository if you would like to check!如果您想查看,这里是我的 GitHub 存储库的链接!

GitHub repository GitHub 存储库

I am not sure how to solve this since this is the first time I try to deploy a website.我不知道如何解决这个问题,因为这是我第一次尝试部署网站。 I tried installing some dependencies like Webpack , Babel , and Parcel to bundle my files into a readable JavaScript file, but my guess is that something is not being translated properly, meaning that there might be a syntax error somewhere in my code.我尝试安装一些依赖,如WebpackBabel和 Parcel 来将我的文件捆绑到一个可读的 JavaScript 文件中,但我猜是有些东西没有被正确翻译,这意味着我的代码中的某处可能存在语法错误。

When running the Webpack dependency I did get a series of errors, that is why I installed some other libraries and loaders:在运行 Webpack 依赖项时,我确实遇到了一系列错误,这就是我安装其他一些库和加载器的原因:

Error on Terminal终端错误

错误终端

I ran into the same issue.我遇到了同样的问题。 The issue occurred wherever I deployed a production build to - locally or Firebase.问题发生在我将生产构建部署到本地或 Firebase 的任何地方。 I found that I had some comments in my render/return code and removing them solved this for me, as discussed at https://github.com/facebook/create-react-app/issues/8687 .我发现我的渲染/返回代码中有一些注释,删除它们为我解决了这个问题,如https://github.com/facebook/create-react-app/issues/8687所讨论的。

I removed the comments as suggested, but ended up using gh-pages instead of deploying via a docs directory on github, so it worked in the end.我按照建议删除了评论,但最终使用了 gh-pages 而不是通过 github 上的 docs 目录进行部署,因此它最终起作用了。 I have deployed other apps after that with comments and they work just fine.之后我已经使用评论部署了其他应用程序,它们工作得很好。

So if you ever run into this, try gh-pages instead因此,如果您遇到这种情况,请尝试使用 gh-pages

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM