Ich habe gerade auf Angular2 RC5 aktualisiert. Die App lädt in allen Browser Ausnahme IE10. Ich bekomme eine Ausnahme "Kein Provider für PlatformRef!" wenn ich die Anwendung bootstrap. In RC4 hat alles gut funktioniert. Ich habe im Internet einige Posts über diese Ausnahme gesehen, aber sie waren alle mit Meteor verwandt. Ich benutze keinen Meteor. Mein Projekt stammt von AngularSeed (vorherige Version, die ich manuell auf RC5 aktualisiert habe). Irgendeine Idee, wie das zu beheben ist? Vielen Dank!Kein Provider für PlatformRef Fehler nach dem Upgrade auf Angular2 RC5 in IE10
In IE10, bekomme ich diesen Fehler:
No provider for PlatformRef!
{
[functions]: ,
context: <Permission denied>,
injectors: [ ],
keys: [ ],
message: "No provider for PlatformRef!",
name: "Error",
stack: undefined,
Symbol()_m.sovohbnexgu: undefined,
Symbol()_n.sovohbnexgu: undefined,
Symbol()_o.sovohbnexgu: undefined,
Symbol(rxSubscriber)_p.sovohbnexgu: undefined
}
main.ts:
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
AppModule:
import { provide, NgModule, ExceptionHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { HttpModule } from '@angular/http';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './components/app/app.component';
import { AppExceptionHandler } from './app.exceptionhandler';
import { AppRoutes } from './app.routes';
import { LogService, ... } from './services/';
@NgModule({
declarations: [AppComponent, ...],
imports: [BrowserModule,
RouterModule.forRoot(AppRoutes),
HttpModule,
FormsModule],
providers: [provide(ExceptionHandler, { useClass: AppExceptionHandler }), LogService, ...],
bootstrap: [AppComponent],
})
export class AppModule { }
Abhängigkeiten Versionen:
- "@ angular/common": "2.0.0-rc.5",
- "@ angular/compiler": "2.0.0-rc.5",
- "@ angular/core": "2.0 0,0-rc.5" ,
- "@ Winkel/forms": "0.3.0",
- "@ Winkel/http": "2.0.0-rc.5"
- „@angular/plattform-browser ":" 2.0.0-rc.5 ",
- " @ eckig/plattform-browser-dynamisch ":" 2.0.0-rc.5 ",
- " @ eckig/router ": "3.0.0-rc.1",
- "es6-modul-loader": "^ 0.17.8"
- "core-js": "^ 2.4.0"
- "rxjs": "5.0.0-beta.6"
- "systemjs": "0.19.27" ,
- "zone.js": "0.6.13",
Edit: Wenn ich versuche, PlatformRef den @NgModule Importe hinzufügen, bekomme ich diesen Fehler:
shims.js?1472473326356:4 Uncaught TypeError: Cannot read property 'type' of null(anonymous function)
@ app.js?1472473326358:5getTransitiveModules
@ app.js?1472473326358:5CompileMetadataResolver._getTransitiveNgModuleMetadata
@ app.js?1472473326358:5CompileMetadataResolver.getNgModuleMetadata
@ app.js?1472473326358:5RuntimeCompiler._compileComponents
@ app.js?1472473326358:3RuntimeCompiler._compileModuleAndComponents
@ app.js?1472473326358:3RuntimeCompiler.compileModuleAsync
@ app.js?1472473326358:3PlatformRef_._bootstrapModuleWithZone
@ app.js?1472473326358:48PlatformRef_.bootstrapModule
@ app.js?1472473326358:48bootstrapper
@ app.js?1472473326358:57(anonymous function)
[...]
Ich bekomme das Stack auf IE:
"TypeError: Unable to get property 'type' of undefined or null reference
at Anonymous function (eval code:13673:13)
at Call (http://localhost:5555/node_modules/es6-shim/es6-shim.js?1472473192889:289:7)
at forEach (http://localhost:5555/node_modules/es6-shim/es6-shim.js?1472473192889:1295:7)
at getTransitiveModules (eval code:13672:9)
at CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata (eval code:13387:13)
at CompileMetadataResolver.prototype.getNgModuleMetadata (eval code:13259:17)
at RuntimeCompiler.prototype._compileComponents (eval code:15845:13)
at RuntimeCompiler.prototype._compileModuleAndComponents (eval code:15769:13)
at RuntimeCompiler.prototype.compileModuleAsync (eval code:15746:13)
at PlatformRef_.prototype._bootstrapModuleWithZone (eval code:9991:13)"
Ohne Polyfills heißt es, dass es keine 'Object.assign' Methode gibt. – kirilloid
Wurde das Problem behoben? Ich bin auch mit dem gleichen Problem konfrontiert und es ist nicht gelöst nach dem Entfernen von es6-shim. – Sanjeev
Ja, das Entfernen des Es6-Shims funktioniert überhaupt nicht, soweit ich das beurteilen kann. IE hat immer noch keine Unterstützung für Object.assign. – Robert