rd-dev-ukraine / angular-io-slimscroll

Customizable slimScroll directive for Angular 2.
MIT License
18 stars 19 forks source link

Error compile with Angular 5 command ng build --prod #25

Open vilsonei opened 6 years ago

vilsonei commented 6 years ago

When trying to compile for production I get the following angular error:

Command used: ng build --prod

Error console: ERROR in ..\angular-io-slimscroll\slimscroll.directive.ts(3,2): Error during template compile of 'SlimScroll' Function expressions are not supported in decorators in 'Directive' 'Directive' contains the error at ..\@angular\core\core.ts(404,32) Consider changing the function expression into an exported function.

tungltdev commented 6 years ago

When trying to compile for production I get the following angular error:

Command used: ng build --prod

Error console: ERROR in ..\angular-io-slimscroll\slimscroll.directive.ts(3,2): Error during template compile of 'SlimScroll' Function expressions are not supported in decorators in 'Directive' 'Directive' contains the error at ..\@angular\core\core.ts(404,32) Consider changing the function expression into an exported function. :(

Manjunath-Siddappa commented 6 years ago

Same error here as well

Command used: 'ng build' - no errors

For 'ng build --prod' below error

ERROR in ..\angular-io-slimscroll\slimscroll.directive.ts(3,2): Error during tem plate compile of 'SlimScroll' Function expressions are not supported in decorators in 'Directive' 'Directive' contains the error at ..\@angular\core\core.ts(404,32) Consider changing the function expression into an exported function.

tungltdev commented 6 years ago

Please show me how to fix it

lunatixcoder commented 6 years ago

Have you done an npm install?

lunatixcoder commented 6 years ago

Ok... so I actually dont know why this worked, but for me, I did a commit to github of my project deleted my local cloned copy and recloned my project. I set my angular CLI to @latest (local and global), then did an npm install on my project and it worked fine for me. My theory (unproven) is that it might be how the node_modules are treated by the packagelock if you have not cleaned your project cache. But its just a theory and results may vary, because with Angular5, ive found it doesnt seem to give consistent results unless you are working on a clean project and not one that you had upgraded from 4.

tungltdev commented 6 years ago

yes, i have upgraded angular 4 to angular 5, how can i use it, i tried npm cache clear but not allowed, it error --force

Serrulien commented 6 years ago

seems like a problem of compatibility between his compiler version and our projects setup. Compile the directive within my project did the trick.

rpavila commented 6 years ago

I got the same issue but when I removed node_modules inside angular-io-slimscroll it's worked fine. I'm think the real issue it's with dependencies' versions inside package.json

martin-g commented 6 years ago

The problem is indeed in the existence of node_modules/angular-io-slimscroll/node_modules/. Removing this inner node_modules fixes the issue! @rd-dev-ukraine could you please release a new version without it ?

MarwaAbuEssa commented 6 years ago

the same here