I have a library which is built with typescript and compiled with Angular 5 compiler. Now, there are few classes/interfaces which are defined inside a namespace.
export namespace A{
export class C1 {
}
export interface I1{
}
}
When I compile this code with angular 5 ngc compiler, it generates the filename.metadata.json file which contains [null] value.
And when I use this library in my Angular 5 application it gives error for this null .metadata.json file.
TypeError: Cannot read property 'version' of null
Note: This was working with Angular 4.3.3. Also when I use typescript compiler tsc then it does not even generate the .metadata.json file. Hence no error.
In Angular 5.1.2 release, Angular team has fixed the issue in the compiler. As per their fix, they do emit invalid “.metadata.json” files anymore. Hence, for the files which contain only nested namespaces, “.metadata.json” files are not generated.