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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build optimizer breaks custom web element library #19705

Closed
tgoze opened this issue Jan 1, 2021 · 2 comments
Closed

Build optimizer breaks custom web element library #19705

tgoze opened this issue Jan 1, 2021 · 2 comments

Comments

@tgoze
Copy link

tgoze commented Jan 1, 2021

馃悶 bug report

Affected Package

This issue is caused by @angular/compiler

Is this a regression?

This did not work as far back as v. 9.

Description

When installing a custom web element library (specifically @microsoft/fast-components) through node with the custom elements schema enabled, the custom web elements render fine in development mode. However, when building the application in the default "production" configuration with buildOptimizer set to true, the custom elements will cause a "call stack size exceeded" error. This error does not happen normally on these elements.

馃敩 Minimal Reproduction

Pull the repro from here. This is a base Angular 11 project with @microsoft/fast-components installed. The components are included as instructed on this site.

Normal behavior:

  1. Pull the repo
  2. Run npm i
  3. Run npm start
  4. Open localhost:4200
  5. See a simple textbox and radio button rendered and no console errors

Reproduce error:

  1. Run npm start-prod
  2. Open localhost:5005
  3. Observe the console error and the radio button un-rendered

If buildOptimizer in angular.json for the production mode is set to false the error will not occur for npm start-prod.

馃敟 Exception or Error


polyfills-es2015.1f913f16a2d346cc8bdc.js:1 Uncaught RangeError: Maximum call stack size exceeded
    at mi.watch (main-es2015.1dde2514dd0a5acad672.js:1)
    at ai.getValue (main-es2015.1dde2514dd0a5acad672.js:1)
    at HTMLElement.get [as checked] (main-es2015.1dde2514dd0a5acad672.js:1)
    at mi.watch (main-es2015.1dde2514dd0a5acad672.js:1)
    at ai.getValue (main-es2015.1dde2514dd0a5acad672.js:1)
    at HTMLElement.get [as checked] (main-es2015.1dde2514dd0a5acad672.js:1)
    at mi.watch (main-es2015.1dde2514dd0a5acad672.js:1)
    at ai.getValue (main-es2015.1dde2514dd0a5acad672.js:1)
    at HTMLElement.get [as checked] (main-es2015.1dde2514dd0a5acad672.js:1)
    at mi.watch (main-es2015.1dde2514dd0a5acad672.js:1)
main-es2015.1dde2514dd0a5acad672.js:1 ERROR RangeError: Maximum call stack size exceeded
    at getNotifier (main-es2015.1dde2514dd0a5acad672.js:1)
    at mi.watch (main-es2015.1dde2514dd0a5acad672.js:1)
    at ai.getValue (main-es2015.1dde2514dd0a5acad672.js:1)
    at HTMLElement.get [as checked] (main-es2015.1dde2514dd0a5acad672.js:1)
    at mi.watch (main-es2015.1dde2514dd0a5acad672.js:1)
    at ai.getValue (main-es2015.1dde2514dd0a5acad672.js:1)
    at HTMLElement.get [as checked] (main-es2015.1dde2514dd0a5acad672.js:1)
    at mi.watch (main-es2015.1dde2514dd0a5acad672.js:1)
    at ai.getValue (main-es2015.1dde2514dd0a5acad672.js:1)
    at HTMLElement.get [as checked] (main-es2015.1dde2514dd0a5acad672.js:1)
un @ main-es2015.1dde2514dd0a5acad672.js:1

馃實 Your Environment

Angular Version:


Angular CLI: 11.0.5
Node: 12.14.0
OS: win32 x64

Angular: 11.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.5
@angular-devkit/build-angular   0.1100.5
@angular-devkit/core            11.0.5
@angular-devkit/schematics      11.0.5
@schematics/angular             11.0.5
@schematics/update              0.1100.5
rxjs                            6.5.5
typescript                      4.0.5

@JoostK JoostK transferred this issue from angular/angular Jan 1, 2021
@alan-agius4 alan-agius4 added area: devkit/build-optimizer needs: investigation Requires some digging to determine if action is needed labels Jan 4, 2021
@ngbot ngbot bot added this to the needsTriage milestone Jan 4, 2021
@alan-agius4
Copy link
Collaborator

Hi,

I had a look at this issue and it appears to caused when turning terser'spure_getters flag on

pure_getters: buildOptions.buildOptimizer,

Let's continue tracking this here: #15761

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants