I\'m getting following error when I build the Angular app using \"ng build --prod\". This is working when I build with Angular 4 and getting error with Angular 5. With Angul
Ran into this issue and wanted to consolidate existing suggestions, and suggest some general strategies when nothing else worked for me:
Pipe; I was using custom Pipe injected straight into an Angular Service.Pipe, the issue went away; so I removed the Pipe transform -- I moved the transformation to a different Service, stopped depending on Pipe altogether.declarations (and exports) properties of your NgModule
node_modules), copy the Pipe to your own project (if possible), and/or re-export the Pipe from one of your NgModule
exclude property of the tsconfig.json (this may not be an option for everyone)
ng build --aot=false (may be a faster build, but then creates a non-optimized app; learn more about AOT)
declaratations array of two or more different NgModules
import { YourPipe } from './yoUr-pippe.ts', make sure there are no typos or capitalization issues in your import statement, especially the filename
'./yoUr-pippe.ts' has a capitalization issue, and a typo, and shouldn't use the ts file extension (that's implied in Typescript))Ensure any ts file which uses the problematic Pipe/Component, lives in an NgModule which imports the NgModule that defined the Pipe/Component!
AModule, defines AComponent, which uses BPipe, defined in BModule, then AModule must import the BModule
NgModule dependency tree. I used a "shared module" pattern so my Pipe could be re-used in multiple places.Ensure there are no circular NgModule dependencies, like in these examples
If you are able, Upgrade NodeJS itself and/or angular and its tools (angular-cli, etc)
Cannot determine the module... issue (which stopped happening!)Be careful about using index.ts files aka "barrel files", and the order of exports
index.ts file issues)A general problem-solving approach : Remove / comment-out any references to the problematic file,
Can't bind to '___' since it isn't a known property of '___', or Property '___' does not exist on type '___'. Did you mean '____', or Expected 0 arguments, but got 1.)ng build works. When I uncommented/added all my code back... my ng build no longer had the Cannot determine the module... issue