简体   繁体   English

如何捕获 SCRIPT1010:react.js 中的预期标识符错误?

[英]How to catch SCRIPT1010: Expected identifier error in react.js?

I need to catch that error so that i can render the app in simple HTML way for the environment having such error types.我需要捕获该错误,以便我可以针对具有此类错误类型的环境以简单的 HTML 方式呈现应用程序。 Is there a way, so that i can catch that error?有没有办法让我捕捉到那个错误?

the issue is by default the application was being rendered on IE7 that is not on only IE IE11/EDGE that support the transpiled build.问题是默认情况下,应用程序在 IE7 上呈现,而不仅仅是在支持转译构建的 IE IE11/EDGE 上。 So I had to mention the meta information to let browser know that the intended browser is IE11/edge.所以我不得不提到元信息让浏览器知道预期的浏览器是 IE11/edge。 Add this in the head section of your index.html:在 index.html 的头部添加这个:

Now may be you will get some error in console that reads:现在可能你会在控制台中收到一些错误,内容如下:

SCRIPT5009: 'Set' is undefined
refer for the link for above error

Link: https://reactjs.org/docs/javascript-environment-requirements.html链接: https://reactjs.org/docs/javascript-environment-requirements.html

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

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