Reputation: 4855
I am working on an Angular 4 project that utilizes angular-cli. It is finally almost done -- and yet another stumbling block.
If I run ng build
the project builds fine.
If I run ng build --prod
the following error is thrown:
ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in C:/SRC/Sandbox/eat-sleep-code.com/node_modules/ng2-gist/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in C:/SRC/Sandbox/eat-sleep-code.com/node_modules/ng2-gist/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in C:/SRC/Sandbox/eat-sleep-code.com/node_modules/ng2-gist/node_modules/@angular/core/src/di/opaque_token.d.ts
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\SRC\Sandbox\eat-sleep-code.com\src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts
How do I get around this?
Upvotes: 1
Views: 716
Reputation: 214007
Angular library should not contain node_modules
. It will raise unpredictable errors.
I would advice you to create your own copy ng2Gist
directive in your project because it is very simple directive
Upvotes: 1