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

Versions
@angular/core: 10.0.0angular-calendar: 0.28.16Thanks so much for opening an issue! If you'd like me to give priority to answering your issue or would just like to support this project, then please consider sponsoring me
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
same here with both versions, 9 and 10
zone-evergreen.js:171 Uncaught RangeError: Maximum call stack size exceeded
at Module.__assign (tslib.es6.js:1)
at Object.adapterFactory (index.js:17)
at Object.adapterFactory (index.js:17)
at Object.adapterFactory (index.js:17)
at Object.adapterFactory (index.js:17)
at Object.adapterFactory (index.js:17)
at Object.adapterFactory (index.js:17)
at Object.adapterFactory (index.js:17)
at Object.adapterFactory (index.js:17)
at Object.adapterFactory (index.js:17)
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
@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
Fixed on Angular Cli 10.0.1
Thanks Matt for your job!! :)
That is fantastic news, thanks for letting me know @ritxweb!
Despite the new version of angular/cli error is still happening
Angular CLI: 10.0.1
Node: 10.16.0
OS: darwin x64
@pisix it doesn't happen for me anymore. Try updating your nodejs to the latest version, 14.4
Thanks @JaxonWright everything is ok now after updating nodejs to the latest version
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
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.
@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.
Deleted node_modules and ran npm install this worked for me! if anyone is still facing the issue you can find my ng version below
`Angular CLI: 10.1.0
Node: 14.16.0
OS: win32 x64
Angular: 10.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker
Ivy Workspace: Yes`
try :
npm cache clean --force
i still have the problem despite all the advice... I am trying to upgrade from ng v7 to v10
Angular CLI: 10.2.3
Node: 14.16.0
OS: darwin x64
Angular: 10.2.5
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Ivy Workspace: Yes
Package Version
--------------------------------------------------------------------
@angular-devkit/architect 0.1002.3
@angular-devkit/build-angular 0.1002.3
@angular-devkit/build-webpack 0.1002.3
@angular-devkit/core 10.2.3
@angular-devkit/schematics 7.3.10
@angular/cdk 10.2.7
@angular/cli 10.2.3
@angular/fire 6.1.5
@angular/http 7.2.16
@angular/material 10.2.7
@nguniversal/common 0.0.0
@nguniversal/express-engine 0.0.0
@nguniversal/module-map-ngfactory-loader 0.0.0
@schematics/angular 7.3.10
@schematics/update 0.1002.3
rxjs 6.6.7
typescript 4.0.8
webpack 4.46.0
Most helpful comment
@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