Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular production builds with script optimizations cause recursion RangeError #18

Closed
rajsite opened this issue Jul 7, 2021 · 3 comments · Fixed by #68
Closed

Angular production builds with script optimizations cause recursion RangeError #18

rajsite opened this issue Jul 7, 2021 · 3 comments · Fixed by #68

Comments

@rajsite
Copy link
Member

rajsite commented Jul 7, 2021

The optimization pass for scripts introduces an error at runtime in production builds. Temporarily disable script optimizations until fixed. Optimizations in the production build of the example-client-app were disabled in: d67778a

Example stack:

Uncaught RangeError: Maximum call stack size exceeded
    at va.has (main.e90fa8c4bcbabc2a18ca.js:1)
    at va.subscribe (main.e90fa8c4bcbabc2a18ca.js:1)
    at wa.subscribe (main.e90fa8c4bcbabc2a18ca.js:1)
    at $a.watch (main.e90fa8c4bcbabc2a18ca.js:1)
    at Ta.getValue (main.e90fa8c4bcbabc2a18ca.js:1)
    at e.get [as _rawValue] (main.e90fa8c4bcbabc2a18ca.js:1)
    at e.get rawValue [as rawValue] (main.e90fa8c4bcbabc2a18ca.js:77)
    at e.resolveRawValue (main.e90fa8c4bcbabc2a18ca.js:77)
    at e.resolveRealValue (main.e90fa8c4bcbabc2a18ca.js:77)
    at e.get value [as value] (main.e90fa8c4bcbabc2a18ca.js:77)
rajsite added a commit that referenced this issue Jul 7, 2021
The optimization pass for scripts introduces an error at runtime in production builds. Temporarily disable script optimizations until fixed. See #18
@rajsite
Copy link
Member Author

rajsite commented Jul 8, 2021

Looks related to this issue: angular/angular-cli#11439 (comment)
Similar to others, disabling the unsafe pure_getters option manually has very little change on bundle size (271.52 kB broken and 272.34kB running). Unfortunate that Angular is not allowing an option for disabling unsafe transforms.

@rajsite
Copy link
Member Author

rajsite commented Jul 8, 2021

Disabling build optimizer seems to work: amcharts/amcharts4#1146 (comment)
Results in a dist size of 456.51kB 😢

rajsite added a commit that referenced this issue Jul 8, 2021
@rajsite
Copy link
Member Author

rajsite commented Jul 8, 2021

Looks like we need the custom optimization levels feature: angular/angular-cli#15761
Another project that had the exact same issue with fast-elements and angular: angular/angular-cli#19705
Issue that sounds the same in fast-element: microsoft/fast#4793

rajsite added a commit that referenced this issue Aug 6, 2021
# Pull Request

## 🤨 Rationale

Updated to fast-element 1.4.1 which includes the following change to work with angular optimized builds: microsoft/fast#4969

Also updates the jasmine-core version which was conflicting with peer dependency resolutions. Regenerated the lockfile for latest versions of listed packages. Fixes #18.

## 👩‍💻 Implementation

See above.

## 🧪 Testing

Tested built angular application with optimizations locally in chrome, firefox, and safari.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or determined no changes are needed.
rajsite pushed a commit that referenced this issue Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant