未捕获的 RangeError:仅在生产中超出最大调用堆栈大小

Posted

技术标签:

【中文标题】未捕获的 RangeError:仅在生产中超出最大调用堆栈大小【英文标题】:Uncaught RangeError: Maximum call stack size exceeded ONLY on Production 【发布时间】:2018-02-03 16:43:55 【问题描述】:

8 月 28 日更新:下面的包配置完全相同,但使用 zone.js 0.8.16 不会产生任何错误。知道为什么吗?

编辑:我一直试图找出问题出在哪里。如果这是一个无限循环,它到底发生在哪里,但我无法破译 polyfills 或 vendor 中的代码。

我正在使用 Firebase 托管部署我的 Angular 应用。使用 localhost 编译和测试时,一切正常。但是当我在 Firebase Hosting 上部署时,我的实时站点永远无法绕过使用 Auth0 登录,在控制台中无休止地给我同样的错误。我怎样才能找出导致错误的确切原因?

Uncaught RangeError: Maximum call stack size exceeded
(anonymous) @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
o.(anonymous function) @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
(anonymous) @ vendor.bd83d2a24392414468c4.bundle.js:1
_makeRequest @ vendor.bd83d2a24392414468c4.bundle.js:1
_sendProcessedPayload @ vendor.bd83d2a24392414468c4.bundle.js:1
_send @ vendor.bd83d2a24392414468c4.bundle.js:1
_processException @ vendor.bd83d2a24392414468c4.bundle.js:1
_handleStackInfo @ vendor.bd83d2a24392414468c4.bundle.js:1
captureException @ vendor.bd83d2a24392414468c4.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1
L @ polyfills.70fc3f963669a0ddfcd2.bundle.js:1
r @ vendor.bd83d2a24392414468c4.bundle.js:1

这是我在项目中的包列表:

├── @agm/core@1.0.0-beta.1 ├── @angular/cli@1.3.2 ├── @angular/common@4.3.6 ├── @angular/compiler@4.3.6 ├── @angular/compiler-cli@4.3.6 ├── @angular/core@4.3.6 ├── @angular/forms@4.3.6 ├── @angular/http@4.3.6 ├── @angular/platform-browser@4.3.6 ├── @angular/platform-browser-dynamic@4.3.6 ├── @angular/router@4.3.6 ├── @ngx-translate/core@7.2.0 ├── @ngx-translate/http-loader@1.0.2 ├── @types/jasmine@2.5.54 ├── @types/node@8.0.25 ├── angular2-jwt@0.2.3 ├── apollo-angular@0.13.0 ├── apollo-client@1.9.1 ├── auth0-js@8.9.3 ├── bootstrap@4.0.0-alpha.6 ├── codelyzer@3.1.2 ├── core-js@2.5.0 ├── graphql-tag@2.4.2 ├── jasmine-core@2.8.0 ├── jasmine-spec-reporter@4.2.1 ├── jquery@3.2.1 ├── karma@1.7.0 ├── karma-chrome-launcher@2.2.0 ├── karma-cli@1.0.1 ├── karma-coverage-istanbul-reporter@1.3.0 ├── karma-jasmine@1.1.0 ├── karma-jasmine-html-reporter@0.2.2 ├── mq-scss@1.2.4 ├── mydatepicker@2.0.27 ├── ngx-stripe@0.1.0 ├── ngx-swiper-wrapper@4.6.0 ├── protractor@5.1.2 ├── raven-js@3.17.0 ├── replace-in-file@2.6.3 ├── rxjs@5.4.3 ├── sass-mq@3.3.2 ├── ts-node@3.3.0 ├── tslint@5.7.0 ├── typescript@2.3.4 └── zone.js@0.8.17

如果我运行ng serve 一切正常,我可以登录。如果我运行ng build --prod 然后firebase serve(试图模拟生产环境)我在尝试登录时收到上述错误。登录 = 只需调用 Auth0 的 webAuth 客户端库,它永远不会回调我的函数。

【问题讨论】:

如果是这样,为什么它只发生在生产(实时)服务器上,而从来没有出现在本地主机上? 请提供重现您的问题的方法(例如 git 存储库或至少,您正在使用哪些软件包和版本)。你甚至没有提到你正在使用什么 angular/angular-cli 版本...... 非常抱歉。我现在会更新问题。 【参考方案1】:

此错误已报告here 和here,可能会在zone.js 的下一版本中修复

【讨论】:

以上是关于未捕获的 RangeError:仅在生产中超出最大调用堆栈大小的主要内容,如果未能解决你的问题,请参考以下文章

“未捕获的 RangeError:在 Dt (jquery.min.js:2) 处超出了最大调用堆栈大小”

淘汰赛未捕获 RangeError:超过最大调用堆栈大小

Angular2幻灯片

“RangeError:超出最大调用堆栈大小”为啥?

RangeError:超出最大调用堆栈大小

猫鼬:UnhandledPromiseRejectionWarning:RangeError:超出最大调用堆栈大小