首页 > 解决方案 > Google API 与来自 `react-router` v3 的 `Link` 一起使用时似乎会导致某种错误

问题描述

我的网络应用程序使用 React 并支持 Google Auth。从版本 3开始使用时,我仅在 IE11 中遇到错误,并且堆栈跟踪表明问题来自 Google API 代码。Linkreact-router

这些是我正在使用的软件包版本:

“反应”:“^16.8.6”

“反应域”:“^16.8.6”

“反应路由器”:“^3.2.3”

笔记:

这是使用fromcomponentDidCatch的组件中记录的错误和堆栈跟踪。 Linkreact-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"
}

我很难找到解决方案,所以我将不胜感激任何见解。谢谢!

标签: reactjsgoogle-apireact-router

解决方案


推荐阅读