Skip to content

Angular 2 notifications runtime error in Angular2-Rc.5 webpack using ng build --prod #60

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

Closed
theunreal opened this issue Aug 21, 2016 · 7 comments

Comments

@theunreal
Copy link

theunreal commented Aug 21, 2016

The app works when on localhost:4200, but when using
ng build --prod
command to build the application to production mode, I get the following error at the runtime:

polyfills.c27b87b….bundle.js:1 Unhandled Promise rejection: Template parse errors:
Can't bind to 'item' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'item' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("<simple-notification
                *ngFor="let a of notifications; let i = index"
                [ERROR ->][item]="a"
                [timeOut]="timeOut"
                [clickToClose]="clickToClose"
"): t@4:16
Can't bind to 'timeOut' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'timeOut' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("          *ngFor="let a of notifications; let i = index"
                [item]="a"
                [ERROR ->][timeOut]="timeOut"
                [clickToClose]="clickToClose"
                [maxLength]="maxLen"): t@5:16
Can't bind to 'clickToClose' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'clickToClose' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("
                [item]="a"
                [timeOut]="timeOut"
                [ERROR ->][clickToClose]="clickToClose"
                [maxLength]="maxLength"
                [showProgressBa"): t@6:16
Can't bind to 'maxLength' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'maxLength' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("
                [timeOut]="timeOut"
                [clickToClose]="clickToClose"
                [ERROR ->][maxLength]="maxLength"
                [showProgressBar]="showProgressBar"
                [pauseOnH"): t@7:16
Can't bind to 'showProgressBar' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'showProgressBar' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("              [clickToClose]="clickToClose"
                [maxLength]="maxLength"
                [ERROR ->][showProgressBar]="showProgressBar"
                [pauseOnHover]="pauseOnHover"
                [th"): t@8:16
Can't bind to 'pauseOnHover' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'pauseOnHover' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("        [maxLength]="maxLength"
                [showProgressBar]="showProgressBar"
                [ERROR ->][pauseOnHover]="pauseOnHover"
                [theClass]="theClass"
                [rtl]="rtl"
"): t@9:16
Can't bind to 'theClass' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'theClass' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("  [showProgressBar]="showProgressBar"
                [pauseOnHover]="pauseOnHover"
                [ERROR ->][theClass]="theClass"
                [rtl]="rtl"
                [animate]="animate"
"): t@10:16
Can't bind to 'rtl' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'rtl' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("                [pauseOnHover]="pauseOnHover"
                [theClass]="theClass"
                [ERROR ->][rtl]="rtl"
                [animate]="animate"
                [position]="i"
"): t@11:16
Can't bind to 'animate' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'animate' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("
                [theClass]="theClass"
                [rtl]="rtl"
                [ERROR ->][animate]="animate"
                [position]="i"
                [icons]="icons"
"): t@12:16
Can't bind to 'position' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'position' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("
                [rtl]="rtl"
                [animate]="animate"
                [ERROR ->][position]="i"
                [icons]="icons"
                >
"): t@13:16
Can't bind to 'icons' since it isn't a known property of 'simple-notification'.
1. If 'simple-notification' is an Angular component and it has 'icons' input, then verify that it is part of this module.
2. If 'simple-notification' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("
                [animate]="animate"
                [position]="i"
                [ERROR ->][icons]="icons"
                >
            </simple-notification>
"): t@14:16 ; Zone: <root> ; Task: Promise.then ; Value: e {message: "Template parse errors:↵Can't bind to 'item' since … >↵            </simple-notification>↵"): t@14:16", stack: "Error: Template parse errors:↵Can't bind to 'item'…/polyfills.c27b87b9e504b84ce8dc.bundle.js:2:4680)"}

Not sure if this error is from this package or from the angular 2 cli/webpack.

@flauc
Copy link
Owner

flauc commented Aug 21, 2016

I've noticed this error will a bunch of packages. I think it's with the new RC5 release. I think removing mangle() from the build process should solve it.

@Toolo
Copy link

Toolo commented Aug 24, 2016

I'm also experiencing this issue and I can confirm disabling mangle on the Uglify plugin makes it work again. This is the configuration I'm using at the moment:

new webpack.optimize.UglifyJsPlugin({
    beautify: false,
    mangle: false, // Workaround for some modules with issues when mangling
    compress: {
        screw_ie8: true,
    },
    comments: false
}),

@zoechi
Copy link

zoechi commented Aug 24, 2016

See also angular/angular#10618

@flauc
Copy link
Owner

flauc commented Aug 24, 2016

Thanks @zoechi

@theunreal
Copy link
Author

@Toolo What file is it? couldn't find this expression anywhere

@daimor
Copy link

daimor commented Aug 24, 2016

@theunreal angular-cli/addon/ng2/models/webpack-build-production.ts

@Caballerog
Copy link
Contributor

This bug probably will be resolved in RC6 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants