-
Notifications
You must be signed in to change notification settings - Fork 407
Error: Can't set headers after they are sent. #491
Comments
I made a pull request to fix this issue, for now you can change your package.json to make zone.js reference to https://github.com/JiaLiPassion/zone.js.git to see the result. |
…moveAllListeners
…atch. (#500) * fix long-stack-trace zone will not render correctly when reject a promise * fix issue #484 and #491, patch EventEmitter.once and removeAllListeners * add event emitter once test case * prependlistener should add listener at the beginning of the listener array. add test cases for prepend listener and once. * use newest fetch to test
…tch process.nextTick, fix removeAllListeners bug (#516) * fix long-stack-trace zone will not render correctly when reject a promise * fix issue #484 and #491, patch EventEmitter.once and removeAllListeners * add event emitter once test case * prependlistener should add listener at the beginning of the listener array. add test cases for prepend listener and once. * use newest fetch to test * patch process.nextTick * restore ZoneAwareError captureStackTrace function * move captureStackTrace test into node * use hasOwnProperty for check captureStackTrace exist or not * change var to const * add process.spec.ts into node_tests.ts target * add done in process.spec.ts * change var to let * add nexttick order case * add prepareStackTrace callback to ZoneAwareError * fix when EventEmitter removeAllListeners has no event type parameter, should remove all listeners * change some var to let/const, remove unnecessary cancelTask call * modify testcases * remove typo * use zone.scheduleMicrotask to patch process.nextTick * forget use let/const again * add comment to removeAllListeners patch, and remove useCapturing parameter cause it is not needed * update fetch to 2.0.1
…moveAllListeners
So, after more than a year, this is still around in My scenario, I have an SSR Response Service:
Then, in a component, based on some logic, I might need to redirect the user:
The redirect works, but the server logs:
Full stack trace here Any ETA on this fix? |
Bump - same here |
@mike-suggitt , @MrCroft , I don't think the |
@JiaLiPassion I believe so. But my issue (or question, rather) is: how could we set appropriate headers/response codes? |
@MrCroft , sorry I am not familiar with |
@JiaLiPassion actually, I remember that the response headers were in fact being set (at least in my case). And the app worked fine. But I was just seeing that error in the log and it mentioned zone.js. Weird... Haven't been doing SSR recently. |
@MrCroft, yeah, almost all the errors in |
I put the error log here, since it is a little bit long
http://pastie.org/10945816
The reproduce codes app is here
https://github.com/Hongbo-Miao/zonejs-bug
It uses universal-starter, just added socket.io, see in second commit.
To see the error,
npm start
and open page http://localhost:3000/.The app works with zone.js 0.6.21, and it shows the error starts from 0.6.22 and also shows in latest 0.6.26
The text was updated successfully, but these errors were encountered: