Repository navigation
Closed
Description
Versions
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.0.0
Node: 9.11.1
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.0
@angular-devkit/build-angular 0.6.0
@angular-devkit/build-optimizer 0.6.0
@angular-devkit/core 0.6.0
@angular-devkit/schematics 0.6.0
@ngtools/webpack 6.0.0
@schematics/angular 0.6.0
@schematics/update 0.6.0
rxjs 6.1.0
typescript 2.7.2
webpack 4.6.0
Repro steps
git clone https://github.com/buu700/ng6-quill-test.gitcd ng6-quill-testnpm install .ng serve --prod
This project is a small modification of ng new's output which adds import 'parchment';. The relevant code within the parchment package is as follows:
src/registry.ts:
. . .
export enum Scope {
. . .
INLINE_BLOT = INLINE & BLOT, // 0110
. . .
}
. . .
src/blob/abstract/leaf.ts:
. . .
import * as Registry from '../../registry';
class LeafBlot extends ShadowBlot implements Leaf {
static scope = Registry.Scope.INLINE_BLOT;
. . .
Observed behavior
Logged to console:
Uncaught TypeError: Cannot read property 'INLINE_BLOT' of undefined
Desired behavior
As when building/serving without --prod, Registry.Scope should be defined.
Mention any other details that might be useful (optional)
Disabling the build optimizer fixes the issue. I didn't run into this with 6.0.0-rc.7, so the regression is from some time between 6.0.0-rc.8 and 6.0.0 final.
Reacted by iars2, Tom Gruszowski, Deniz, François BOITEUX, aripp, anisabboud, Fergal Moran, Sebastian Podgajny, Adrien Dessilly, Dennis Keil and 21 more
Activity
aripp commentedon May 6, 2018
Yes, that happens here too when I try to start my app that was built with command
ng build --base-href /AppPortal/ --prodI'm using:
aripp commentedon May 8, 2018
Setting "buildOptimizer": false in angular.json did fix the problem for me. The bundle size is as small as before the upgrade to Angular 6.
leocaseiro commentedon May 11, 2018
Thanks @aripp it worked for me too. The bundle is slighter bigger, but works for the time being.
For who wants to test using @angular/elements try my modified version:
cc #7799
leocaseiro commentedon May 14, 2018
See angular/devkit#816
andriykrasnychuk commentedon May 21, 2018
this workaround worked for me:
export enum YourEnum { Prop1 = 'prop1', Prop2 = 'prop2', }loribonna commentedon May 21, 2018
Thanks @andriykrasnychuk for the workaround!
Also i checked that it breaks if there is a cast like
Prop3 = <any>'someValue'.filipesilva commentedon Jun 7, 2018
Does this happen with the 6.1.x betas?
buu700 commentedon Jun 7, 2018
Nope, just tested and it looks like this is no longer an issue. Specifically, it seems to have been fixed by
@angular-devkit/build-optimizer@0.6.1(the next version after what I'd used here).buu700 commentedon Jun 7, 2018
Although, I see that #10983 is using
@angular-devkit/build-optimizer@0.6.3, so maybe they're different issues, and/or maybe this repro is insufficient? I'll try again in my actual project some time soon and see if that behaves any differently.dsoltesz commentedon Jun 7, 2018
I manually added
@angular-devkit/build-optimizer@0.6.8as dev dependency to package json and issue seems to be resolved with this version.buu700 commentedon Jun 9, 2018
Can't reproduce the problem in @cyph either after upgrading to 6.1, so I'll close this again.
Leanvitale commentedon Aug 16, 2018
Try for this..
zernolo commentedon Dec 21, 2018
by this issue, seems that the build-optimizer is not working anymore valor-software/ngx-bootstrap#4948
filipesilva commentedon Dec 21, 2018
@zernolo can you open a new issue with a reproduction please?
angular-automatic-lock-bot commentedon Sep 9, 2019
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.