Internet explorer 升级到IE10中的Angular2 RC5后,没有PlatformRef错误的提供程序
我刚升级到Angular2 RC5。该应用程序在除IE10之外的所有浏览器中都可以正常加载。当我引导应用程序时,我得到一个异常“没有PlatformRef的提供程序!”。在RC4中,一切正常。我在网上看到了一些关于这个例外的帖子,但它们都与Meteor有关。我不用流星。我的项目来自AngularSeed(我手动更新为RC5的以前版本)。你知道怎么解决这个问题吗?谢谢 在IE10中,我得到以下错误:Internet explorer 升级到IE10中的Angular2 RC5后,没有PlatformRef错误的提供程序,internet-explorer,angular,internet-explorer-10,angular-seed,Internet Explorer,Angular,Internet Explorer 10,Angular Seed,我刚升级到Angular2 RC5。该应用程序在除IE10之外的所有浏览器中都可以正常加载。当我引导应用程序时,我得到一个异常“没有PlatformRef的提供程序!”。在RC4中,一切正常。我在网上看到了一些关于这个例外的帖子,但它们都与Meteor有关。我不用流星。我的项目来自AngularSeed(我手动更新为RC5的以前版本)。你知道怎么解决这个问题吗?谢谢 在IE10中,我得到以下错误: No provider for PlatformRef! { [functions]: ,
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
}
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)
[...]
应用模块:
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 { }
依赖项版本:
- “@angular/common”:“2.0.0-rc.5”
- “@angular/compiler”:“2.0.0-rc.5”
- “@angular/core”:“2.0.0-rc.5”
- “@angular/forms”:“0.3.0”
- “@angular/http”:“2.0.0-rc.5”
- “@angular/platform浏览器”:“2.0.0-rc.5”
- “@angular/platform browser dynamic”:“2.0.0-rc.5”
- “@angular/router”:“3.0.0-rc.1”
- “es6模块加载器”:“^0.17.8”
- “核心js”:“^2.4.0”
- “rxjs”:“5.0.0-beta.6”
- “systemjs”:“0.19.27”
- “zone.js”:“0.6.13”
编辑:如果我尝试将PlatformRef添加到@NgModule导入中,则会出现以下错误:
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
}
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)
[...]
我在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)"
我认为您应该在从
@angular/core
导入PlatformRef
并将其添加到AppModule文件的NgModule
配置中后检查相同的设置。解决方案是从依赖项中删除es6垫片。现在可以正常工作。我尝试了,但现在出现了一个错误:“TypeError:无法读取null的属性'type'”我还尝试将其添加到模块上的提供程序列表中,但它无法解决问题。您得到的是“TypeError:无法读取null的属性'type'”错误?不推荐使用“@angular/core”中的另一个提供,因此您必须将Appmodule中的ExceptionHandler
提供程序设置更改为{provide:ExceptionHandler,useClass:AppExceptionHandler}
谢谢!我更新了提供调用并编辑了我的问题以提供堆栈跟踪。请在将声明:[AppComponent,…]
更改为声明:[AppComponent]
后进行检查。W/o polyfills表示没有对象。assign
方法。此问题解决了吗?我也面临着同样的问题,在拆除es6垫片后,问题没有得到解决。是的,就我所知,拆除es6垫片根本不起作用。IE仍然不支持Object.assign。