Ich bin auf dem Ahead-of-Time kompilierte Anwendung diese Fehler:Angular 2 Kein Anbieter für CompilerFactory
Error: No provider for CompilerFactory!
at NoProviderError.BaseError [as constructor] (http://localhost:5050/app.js:2413:26)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:5050/app.js:2612:19)
at new NoProviderError (http://localhost:5050/app.js:2651:19)
at ReflectiveInjector_._throwOrNull (http://localhost:5050/app.js:4637:22)
at ReflectiveInjector_._getByKeyDefault (http://localhost:5050/app.js:4671:28)
at ReflectiveInjector_._getByKey (http://localhost:5050/app.js:4625:28)
at ReflectiveInjector_.get (http://localhost:5050/app.js:4385:24)
at PlatformRef_._bootstrapModuleWithZone (http://localhost:5050/app.js:10924:64)
at PlatformRef_.bootstrapModule (http://localhost:5050/app.js:10910:24)
at http://localhost:5050/app.js:64873:22
Anwendung verwendet NGC gebaut, um die .ngfactory-Dateien zu generieren, dann TSC mit einer anderen main
Datei, um die JS zu bekommen, dann Rollup mit Babel, um den Build zu vervollständigen. Nach this führen ziemlich genau.
Hier ist meine :
import "reflect-metadata";
import { enableProdMode } from "@angular/core";
import { platformBrowser } from "@angular/platform-browser";
import { AppModuleNgFactory } from "./app.module.ngfactory";
enableProdMode();
platformBrowser().bootstrapModule(<any> AppModuleNgFactory)
Haben Sie dieses Problem beheben? – Scironic
Konnten Sie das beheben? Ich laufe auf dasselbe Problem. – xaralis
Ich konnte es mit einer Lösung von @nrobinabertin beheben. Ersetzen Sie 'bootstrapModule' durch' bootstrapModuleFactory' und Sie können loslegen. (no '' cast ist nicht mehr notwendig) –
xaralis