Building Angular 6 library fails, with a vague error.

2,262 views
Skip to first unread message

Sam Amin

unread,
Sep 11, 2018, 10:15:31 AM9/11/18
to Angular and AngularJS discussion
Hi, 
I generated an angular 6 library, using the CLI. Then refactored some code into it. 
Now I'm getting the below error when I build. I can't understand the error, and searching online has not given me any clear indication why this is failing.
 Has anyone seen this before? Obfuscated some names in the log below.

Building Angular Package
Building entry point '****-web-lib'
Rendering Stylesheets
Rendering Templates
Compiling TypeScript sources through ngc

BUILD ERROR
Error during template compile of 'Injectable'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
Error during template compile of 'Injectable'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
@angular\core\core.ts(194,50): Error during template compile of 'NgModule'
  Function calls are not supported in decorators.
................................
..................................
Error during template compile of 'Injectable'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called.

at Object.<anonymous> (C:\Users\****\source\repos\****-web-ui\webapp\node_modules\ng-packagr\lib\ngc\compile-source-files.js:53:68)
at Generator.next (<anonymous>)
at C:\Users\****\source\repos\****-web-ui\webapp\node_modules\ng-packagr\lib\ngc\compile-source-files.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\Users\****\source\repos\****-web-ui\webapp\node_modules\ng-packagr\lib\ngc\compile-source-files.js:3:12)
at Object.compileSourceFiles (C:\Users\****\source\repos\****-web-ui\webapp\node_modules\ng-packagr\lib\ngc\compile-source-files.js:19:12)
at Object.<anonymous> (C:\Users\****\source\repos\****-web-ui\webapp\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:26:32)
at Generator.next (<anonymous>)
at C:\Users\****\source\repos\****-web-ui\webapp\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:7:71
at new Promise (<anonymous
	
	Thanks
	Sam


Sander Elias

unread,
Sep 11, 2018, 10:55:11 AM9/11/18
to Angular and AngularJS discussion
Hi Sam,

I think you can find your answer in this issue

Regards
Sander

Sam Amin

unread,
Sep 12, 2018, 4:04:53 AM9/12/18
to ang...@googlegroups.com
Hi Sander,
Problem with this article is it discusses issues with building an application, that is using a custom library.
My issue occurs when building the custom library itself, haven't even tried to link it yet.
so for example in the article, they're changing the tsconfig file of the main application.
Thanks
Sam

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Sander Elias

unread,
Sep 12, 2018, 11:23:03 AM9/12/18
to Angular and AngularJS discussion
Hi Sam,

Hmm, I see. Can you provide a minimal reproduction where I can take a stab at?

Regards
Sander
Reply all
Reply to author
Forward
0 new messages