angular-calendar: Angular 10 - Maximum call stack size exceeded

Describe the bug

After trying to update to Angular 10, I get what I think is an error related to Angular Calendar or at least the accompanied date_fns library. Whenever I try to run ng serve, I get an ERROR RangeError: Maximum call stack size exceeded error and my project basically stops loading altogether.

Screenshots

image

Versions

  • @angular/core: 10.0.0
  • angular-calendar: 0.28.16
  • Browser name and version: Chrome 83

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 14
  • Comments: 16 (3 by maintainers)

Most upvoted comments

Fixed on Angular Cli 10.0.1 Thanks Matt for your job!! 😃

@andyshear The issue is with the @angular/cli not with @angular/core, the fix still hasn’t been released in the cli (it’s still on version 10.0.0): https://www.npmjs.com/package/@angular/cli

I had similar error. The problem was I was using a component with class selector (selector: '.component-class',) and both: parent compoment and this component had the class in the view:

// parent
<div class="component-class"></div>

// child (actual component template)
<div class="component-class">     // <- this wrapper is the cause of the issue
   ...
</div>

The obvious solution is not to have a wrapper in the child component, just the contents.

Same errors with all different version of Angular/CLI >= 10.0.0.

Now my env is:

Angular CLI: 10.1.0-next.0 Node: 14.5.0 OS: win32 x64 Angular: 10.0.3

@pisix it doesn’t happen for me anymore. Try updating your nodejs to the latest version, 14.4

I can verify this is still happening in angular 10.0.2, as it did in 10.0.0 and 10.0.1

Going to try removing date-fns completely. Calendar seems to be the only thing that broke updating from 8 -> 10 for my app.

core.js:4081 ERROR Error: Uncaught (in promise): RangeError: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded at Module.__assign (tslib.es6.js:1) at Object.adapterFactory (index.ts:18) at Object.adapterFactory (index.ts:19)…

Here are some of the warnings from the build:

…src/app/app.module.ts depends on angular-calendar/date-adapters/date-fns. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

…node_modules/@mattlewis92/dom-autoscroller/dist/bundle.js depends on dom-plane. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

@pisix it doesn’t happen for me anymore. Try updating your nodejs to the latest version, 14.4

I updated my node version to latest version, but the issue still exist.

Thanks @JaxonWright everything is ok now after updating nodejs to the latest version

hmm weird, I know that there is a bug with 10.0.0 of the cli that completely breaks this library: https://github.com/mattlewis92/angular-calendar/issues/1285 but the error message is different from this one, although I think it’s the same issue. Can you try with 10.0.1 of the cli when it’s released next week as I think it should be fixed then when this PR is released: https://github.com/angular/angular-cli/pull/18009