我的申請是ASP.NET Core 1.0 Web API
。 Iam用Angular 2
和typescript
開發前端。角度2錯誤:未捕獲(承諾中):狀態響應:0代表URL:null
如果我刷新網頁之前完全加載Google Chrome
一切工作正常,但如果我做同樣的事情上Mozilla Firefox
蔭收到以下錯誤-消息:
[error.service] An error occured: Object { _body: error, status: 0, ok: false, statusText: "", headers: Object, type: 3, url: null } app.e9e4671abf55fe5a53fc.js:936:46167
s</ConsoleLogger.prototype.error TheNameOfMyWebSite.net/js/app.e9e4671abf55fe5a53fc.js:936:46167
u</ErrorService.prototype.handleError TheNameOfMyWebSite.net/js/app.e9e4671abf55fe5a53fc.js:936:39646
u</CustomHttp.prototype.request/< TheNameOfMyWebSite.net/js/app.e9e4671abf55fe5a53fc.js:936:38047
a</CatchSubscriber.prototype.error TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:543:27790
a TheNameOfMyWebSite.js:311:808
[264]/</</</o</ZoneDelegate.prototype.invokeTask TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:50:8316
onInvokeTask TheNameOfMyWebSite.js:176:9452
[264]/</</</o</ZoneDelegate.prototype.invokeTask TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:50:8229
[264]/</</</n</Zone.prototype.runTask TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:50:3362
ZoneTask/this.invoke TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:50:9349
ERROR Error: Uncaught (in promise): Response with status: 0 for URL: null
Stack-Trace:
[email protected]/js/polyfills.e9e4671abf55fe5a53fc.js:57:1180
[email protected]/js/polyfills.e9e4671abf55fe5a53fc.js:57:796
scheduleResolveOrReject/<TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:57:1803
[264]/</</</o</[email protected]/js/polyfills.e9e4671abf55fe5a53fc.js:50:8316
[email protected]/js/vendor.e9e4671abf55fe5a53fc.js:176:9452
[264]/</</</o</[email protected]/js/polyfills.e9e4671abf55fe5a53fc.js:50:8229
[264]/</</</n</[email protected]/js/polyfills.e9e4671abf55fe5a53fc.js:50:3362
[email protected]/js/polyfills.e9e4671abf55fe5a53fc.js:50:367
ZoneTask/[email protected]/js/polyfills.e9e4671abf55fe5a53fc.js:50:9396
defaultErrorLogger TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:8:473
ee</ErrorHandler.prototype.handleError TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:162:273
next TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:176:14602
Qe</EventEmitter.prototype.subscribe/i< TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:176:6258
c</SafeSubscriber.prototype.__tryOrUnsub TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:211:3724
c</SafeSubscriber.prototype.next TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:211:2960
u</Subscriber.prototype._next TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:211:1927
u</Subscriber.prototype.nextTheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:211:1574
p</Subject.prototype.next TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:211:6849
Qe</EventEmitter.prototype.emit TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:176:6006
Xe</NgZone.prototype.triggerError TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:176:10237
onHandleError TheNameOfMyWebSite.net/js/vendor.e9e4671abf55fe5a53fc.js:176:9812
[264]/</</</o</ZoneDelegate.prototype.handleError TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:50:7683
[264]/</</</n</Zone.prototype.runGuarded TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:50:2951
[264]/</</</n.microtaskDrainDone/< TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:57:2461
[264]/</</</n.microtaskDrainDone TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:57:2430
drainMicroTaskQueue TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:50:477
ZoneTask/this.invoke TheNameOfMyWebSite.net/js/polyfills.e9e4671abf55fe5a53fc.js:50:9396
,但該網站刷新很好,一切工作應該如何,除了Iam收到的錯誤。
我只發現this後,那裏的人有類似的問題。
Stackoverflow上的另一個人也有similar problem,但由於我沒有使用CORS,因爲前端和後端在同一個域上運行,所以這對我不起作用。
這個錯誤信息是什麼意思?我究竟做錯了什麼?
你好@mercador謝謝你的回答。 我們沒有使用CORS,因爲後端和前端運行在同一個域上。 –
@MoritzSchmidt也許你的Firefox瀏覽器安裝了哪些塊腳本的插件? – mercador
好主意,但即使我停用所有插件Iam得到相同的錯誤:/ @mercador –