question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maximum call stack size exceeded with @bugsnag/plugin-angular in SSR

See original GitHub issue

Following #441, I’m now getting RangeError: Maximum call stack size exceeded during server-side rendering in Angular.

capture d ecran 2018-12-21 a 12 49 14

{
  "@bugsnag/js": "^5.1.0",
  "@bugsnag/plugin-angular": "^5.1.0"
}
// core.module.ts

import bugsnag from '@bugsnag/js';
import { BugsnagErrorHandler } from '@bugsnag/plugin-angular';

const bugsnagClient = bugsnag({ ... });

export function errorHandlerFactory() {
  return new BugsnagErrorHandler(bugsnagClient);
}

@NgModule({
  ...
  providers: [
    { provide: ErrorHandler, useFactory: errorHandlerFactory },
    ...
  ]
})
export class CoreModule {}
// core.server.module.ts

import { CoreModule } from '@core/core.module';

@NgModule({
  imports: [
    CoreModule,
    ...
  ]
})
export class CoreServerModule {}

If I’m not mistaken, since @bugsnag/js is universal, it doesn’t need to be initialised differently for server-side rendering, does it?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
axelboccommented, Mar 19, 2019

Thanks @oleksmir, I did manage to update to @bugsnag/js on Node 10 without getting the error by initialising Bugsnag only in the browser. Not ideal since I have errors in SSR that are still not reported, but at least I’m up to date.

0reactions
bengourleycommented, May 16, 2019

I’ve been investigating this issue and cannot reproduce it. I used the project on this page: https://angular.io/guide/universal

Using node v10.15.1, here are the versions of the top-level dependencies that got installed:

angular-io-example@1.0.0 /Users/bengourley/Development/universal-angular
β”œβ”€β”€ @angular-devkit/build-angular@0.11.4
β”œβ”€β”€ @angular/animations@7.2.15
β”œβ”€β”€ @angular/cli@7.3.9
β”œβ”€β”€ @angular/common@7.2.15
β”œβ”€β”€ @angular/compiler@7.2.15
β”œβ”€β”€ @angular/compiler-cli@7.2.15
β”œβ”€β”€ @angular/core@7.2.15
β”œβ”€β”€ @angular/forms@7.2.15
β”œβ”€β”€ @angular/http@7.2.15
β”œβ”€β”€ @angular/platform-browser@7.2.15
β”œβ”€β”€ @angular/platform-browser-dynamic@7.2.15
β”œβ”€β”€ @angular/platform-server@7.2.15
β”œβ”€β”€ @angular/router@7.2.15
β”œβ”€β”€ @angular/upgrade@7.2.15
β”œβ”€β”€ @bugsnag/js@6.2.0
β”œβ”€β”€ @bugsnag/plugin-angular@6.2.0
β”œβ”€β”€ @nguniversal/express-engine@7.1.1
β”œβ”€β”€ @nguniversal/module-map-ngfactory-loader@7.1.1
β”œβ”€β”€ @types/jasmine@2.8.16
β”œβ”€β”€ @types/jasminewd2@2.0.6
β”œβ”€β”€ @types/node@8.9.5
β”œβ”€β”€ angular-in-memory-web-api@0.8.0 (github:brandonroberts/in-memory-web-api-bazel#50a34d84b627ec88816242dec77603d6dcb9c880)
β”œβ”€β”€ core-js@2.6.5
β”œβ”€β”€ jasmine-core@2.99.1
β”œβ”€β”€ jasmine-spec-reporter@4.2.1
β”œβ”€β”€ karma@3.0.0
β”œβ”€β”€ karma-chrome-launcher@2.2.0
β”œβ”€β”€ karma-coverage-istanbul-reporter@2.0.5
β”œβ”€β”€ karma-jasmine@1.1.2
β”œβ”€β”€ karma-jasmine-html-reporter@0.2.2
β”œβ”€β”€ lodash@4.17.11
β”œβ”€β”€ protractor@5.4.2
β”œβ”€β”€ rxjs@6.5.2
β”œβ”€β”€ ts-loader@4.5.0
β”œβ”€β”€ ts-node@7.0.1
β”œβ”€β”€ tslint@5.11.0
β”œβ”€β”€ typescript@3.1.6
β”œβ”€β”€ webpack-cli@3.3.2
└── zone.js@0.8.29

Error reporting works on the server and in the browser, and the node process not crash (unless I throw an error and make it).

Closing this off as it looks like this is no longer an issue. Please feel free to post steps to reproduce if you are still seeing an issue like this and believe Bugsnag to be the cause.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maximum Call Stack Size Exceeded (Typescript Error) - Medium
In your code, the possibility is, You are calling a function that is calling another function and that function is calling another function....
Read more >
Angular 7 error RangeError: Maximum call stack size exceeded
1.This error occur when there is an infinite loop. As you have mentioned that the page loads when app-heroes is commented, this might...
Read more >
Bugsnag docs β€Ί Platforms β€Ί JavaScript β€Ί Angular
Session tracking. Bugsnag tracks the number of β€œsessions” that happen within your application. This allows you to compare stability scores between releases andΒ ......
Read more >
strongdata.ca/wp-content/plugins/leadin/js/dist/gu...
src/api/hubspotPluginApi.js","webpack://wp. ... \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge:Β ...
Read more >
Overview - Joe Sandbox
Report size exceeded maximum capacity and may have missing behavior information. Report size getting too big, too many NtCreateFile calls found. Report size...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found