我的angular4应用程序遇到了一些麻烦,它在Chrome,Edge和Firefox上完美运行但在OSX和IOS上都返回了Safari的错误。
我的所有请求都会收到500错误代码并显示此错误(后端是C#webapi):
{"消息":"发生错误。"," ExceptionMessage":"对象 引用未设置为对象的实例。"," ExceptionType": " System.NullReferenceException"," StackTrace":"在 A_BoardBE.SessionUtils.GetSessionGM(HttpContextBase httpContextBase, IHttpRouteData route)in C:\ Users \用户Aurelien.Joly \源\回购\ A-BoardBE \ A_BoardBE \ SessionUtils.cs:线 30 \ r \ n在A_BoardBE.Controllers.ProjectController.GetModelDate()中 C:\ Users \用户Aurelien.Joly \源\回购\ A-BoardBE \ A_BoardBE \控制器\ ProjectController.cs:线 812 \ r \ n在lambda_method(Closure,Object,Object [])\ r \ n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor<> c__DisplayClass10.b__9(对象 instance,Object [] methodParameters)\ r \ n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext,IDictionary`2参数,CancellationToken cancellationToken)\ r \ n ---从前一个位置开始的堆栈跟踪结束 抛出异常的地方--- \ r \ n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务 任务)\ r \ n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务 任务)\ r \ n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext(个)\ r \ n --- 从抛出异常的先前位置开始的堆栈跟踪结束 --- \ r \ n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务 任务)\ r \ n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务 任务)\ r \ n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext(个)\ r \ n --- 从抛出异常的先前位置开始的堆栈跟踪结束 --- \ r \ n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务 任务)\ r \ n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务 任务)\ r \ n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()" }
但我不明白为什么只有Safari出现此错误。
我的package.json是:
"dependencies": {
"@angular/animations": "^4.0.3",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@swimlane/ngx-charts": "^5.1.2",
"@swimlane/ngx-datatable": "^9.1.0",
"@types/intro.js": "^2.4.3",
"angular2-debounce": "^1.0.3",
"angular2-highcharts": "^0.5.5",
"angular2-notifications": "^0.5.7",
"angular2-uuid": "^1.1.1",
"angulartics2": "^2.3.0",
"animate.css": "3.1.1",
"bootstrap": "^3.3.7",
"chart.js": "^2.5.0",
"classlist.js": "^1.1.20150312",
"core-js": "^2.4.1",
"d3": "^4.8.0",
"file-droppa": "^1.0.0",
"font-awesome": "^4.7.0",
"intl": "^1.2.5",
"intro.js": "^2.7.0",
"jquery": "^3.1.0",
"metismenu": "^2.5.0",
"moment": "^2.18.1",
"ng2-bootstrap": "^1.4.2",
"ng2-charts": "^1.5.0",
"ng2-completer": "^1.2.2",
"ng2-datepicker": "^1.8.3",
"ng2-draggable": "^0.2.1",
"ng2-dragula": "^1.5.0",
"ng2-file-upload": "^1.2.1",
"ng2-handsontable": "^0.48.0",
"ng2-page-scroll": "^4.0.0-beta.6",
"ng2-signalr": "^2.1.0",
"ng2-smart-table": "^1.0.1",
"ng2-toastr": "^4.0.1",
"ng2-ui-switch": "^1.0.2",
"ngx-cookie": "^1.0.0",
"ngx-pagination": "^3.0.0",
"ngx-tooltip": "0.0.9",
"ngx-uploader": "^3.3.11",
"rxjs": "^5.1.0",
"signalr": "^2.2.2",
"underscore": "^1.8.3",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/d3": "^4.8.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"ngx-dropzone-wrapper": "^4.0.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
如果你知道它可能来自哪里,我的polyfills似乎也可以。
提前致谢。