rangle/angular-ssr

TypeError: moduleFactory._injectorClass is not a constructor

cyr-x opened this issue · 1 comments

cyr-x commented

Bug:
I'm running into the same Error with my repo and even with your demand-express example. It always says:
TypeError: moduleFactory._injectorClass is not a constructor

The error is coming from source/platform/platform.ts line 113:

const createInjector = <M>(injector: Injector, moduleFactory: NgModuleFactory<M>): InstantiableModule<M> => new moduleFactory['_injectorClass'](injector);

The argument moduleFactory doesn't have the attribute _injectorClass, it looks like that during runtime:

NgModuleFactory_ {
  moduleType: [Function: RootModule],
  _bootstrapComponents: [ [Function: RootComponent] ],
  _ngModuleDefFactory: [Function]
}

I'm using your demand-express example.

Edit:

It's probably because of this commit angular/angular@ce1d7c4, they removed the _injectorClass attribute from NgModuleFactory

This has been resolved in the latest builds.