SSE Bypass for HMR
See original GitHub issueDescribe the bug
When developing on the Next.js with next dev
, No problem for a while,
but suddenly the server becomes unresponsive.
Environment
msw: 0.29.0
nodejs: 14.16.0
npm: 0.0.0
next: 10.2.3
Please also provide your browser version.
Chrome: Version 91.0.4472.164 (Official Build) (x86_64)
To Reproduce
Steps to reproduce the behavior:
- npm run
next dev
- Edit some code many times.
- Suddenly the server becomes unresponsive.
Expected behavior
Server always responds.
Screenshots
The below capture is the Network tab when no response is returned.
Workaround
It looks like there is a problem in webpack-hmr?page=xxxx
.
As a workaround, I added the below SSE Bypass in generated mockServiceWorker.js
.
Then, I was able to solve the problem that the response did not come back.
self.addEventListener("fetch", function (event) {
const { request } = event;
// Bypass server-sent events.
if (request.headers.get("accept") === "text/event-stream") {
return;
}
// Bypass navigation requests.
if (request.mode === "navigate") {
return;
}
...
}
This Bypass is useful to us, but what do you think?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Blackreach Bypass SSE - Skyrim Special Edition - Nexus Mods
About this mod. Adds a lever that opens the gate at the Tower of Mzark to allow quick access to the Elder Scroll...
Read more >HMR59.pdf - National Weather Service
HMR 59 PMP estimates for a portion of southern California at 10 mi2 ... or are forced to bypass terrain features that act...
Read more >Intertidal intercepted sediment at jetties along the Gulf of ...
Sand bypassing is one of the promising solutions to rectify jetty-induced coastal erosion. Estimating alongshore sediment transport rate and ...
Read more >Techniques for Shared Resource Management in Systems ...
tel MMX [162, 296] and Intel SSE [164] also apply SIMD in order to improve performance. As ... is to bypass the cache...
Read more >3745 Communication Controller Hardware Maintenance ...
The main storage. • The storage control, equipped with a direct memory access (OMA). 1-6 IBM 3745 Hardware Maintenance Reference (HMR).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Analyzing NextJS
Here’s where the
EventSource
is being established on the client:The server-side of NextJS just bypasses this route:
hot-middleware
It appears that the SSE established is not coming from webpack but from NextJS. Huh, so there’s no straightforward way to put this in an integration test in this repo.
I feel that both are related, but I can’t reply without reproduce environment. But I think it’s worth having a reporter try this bypass. The same is true for developer who do not need to intercept SSE.
Of course! I hope it helps until it is fundamentally resolved. Wait a minute. @kettanaito