reactjs - Google API 与来自 `react-router` v3 的 `Link` 一起使用时似乎会导致某种错误
问题描述
我的网络应用程序使用 React 并支持 Google Auth。从版本 3开始使用时,我仅在 IE11 中遇到错误,并且堆栈跟踪表明问题来自 Google API 代码。Link
react-router
这些是我正在使用的软件包版本:
“反应”:“^16.8.6”
“反应域”:“^16.8.6”
“反应路由器”:“^3.2.3”
笔记:
- 我们最近将React升级到v16,升级后才会出现这个错误
- 如果我们不执行任何 Google API 代码,错误就会停止发生。
这是使用fromcomponentDidCatch
的组件中记录的错误和堆栈跟踪。 Link
react-router
{
description: "Cannot define property '$jscomp_hidden_0.37733406515879653': object is not extensible",
message: "Cannot define property '$jscomp_hidden_0.37733406515879653': object is not extensible",
name: "TypeError",
number: -2146823211,
stack: "TypeError: Cannot define property '$jscomp_hidden_0.37733406515879653': object is not extensible
at f (https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.tkLGB8oygGw.O/m=auth2/rt=j/sv=1/d=1/ed=1/am=wQE/rs=AGLTcCOVrdiUrdoKYhlUTq9WIvZT-VXTAA/cb=gapi.loaded_0:11:79)
at Object[q] (https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.tkLGB8oygGw.O/m=auth2/rt=j/sv=1/d=1/ed=1/am=wQE/rs=AGLTcCOVrdiUrdoKYhlUTq9WIvZT-VXTAA/cb=gapi.loaded_0:11:181)
at setInitialDOMProperties (http://10.7.6.197:3000/public/build/scripts/vendor.js:19112:11)
at setInitialProperties (http://10.7.6.197:3000/public/build/scripts/vendor.js:19328:3)
at finalizeInitialChildren (http://10.7.6.197:3000/public/build/scripts/vendor.js:20315:3)
at completeWork (http://10.7.6.197:3000/public/build/scripts/vendor.js:28467:13)
at completeUnitOfWork (http://10.7.6.197:3000/public/build/scripts/vendor.js:30702:9)
at performUnitOfWork (http://10.7.6.197:3000/public/build/scripts/vendor.js:30900:5)
at workLoo"
}
我很难找到解决方案,所以我将不胜感激任何见解。谢谢!
解决方案
推荐阅读
- postgresql - Flask-Alembic 错误 sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) 类型不存在
- algorithm - 使用数组进行归并排序的空间复杂度
- php - 在非对象 PHP PDO 上调用成员函数 prepare()
- python - 谐音替换密码 Python
- r - 如何在 R 中安装“Hmisc”
- regex - 正则表达式包含两个单词,但排除一个空格,后面跟任何不是字符串末尾的空格
- javascript - 当分析调用来自 IFRAME 时,Google Analytics 如何绕过同源策略?
- firebase - 将带有 JSON 数据的 HTTP 请求发送到 Firebase 函数
- linux - 在启动时运行命令
- python - 使用 sqlalchemy 进行多表插入