I had a similar issue to Timothy Matthews' answer here.
• Uncaught ReferenceError: Cannot access main. js: 426358
'Child1Component' before initialization at ‹static initializer> (main.is:426358:225)
Browser console error stack trace screenshot
Example file structure:
/parent.component.ts
/child1/child1.component
/child2/child2.component
/index.ts (exports all the above)
My IDE (intellij) set the imports in parent.component.ts to point at the index.ts in the same directory which also contains the child components, which causes the issue:
import {
ChildComponent1,
ChildComponent2,
} from '../';
I updated my imports to this, which fixed the issue:
import { ChildComponent1 } from '../child1/child1.component';
import { ChildComponent2 } from '../child2/child2.component';
Timothy Matthews notes above that this would also work, but I cannot confirm:
Change index.ts to _index.ts
import {
ChildComponent1,
ChildComponent2,
} from '../_index';