Fix fallback page error overlay (vercel/turbo#268)
This commit is contained in:
parent
dca015b121
commit
c8067af03f
1 changed files with 13 additions and 5 deletions
|
@ -6,15 +6,23 @@ import {
|
|||
initializeHMR,
|
||||
ReactDevOverlay,
|
||||
} from "@vercel/turbopack-next/dev/client";
|
||||
import { onChunkUpdate } from "@vercel/turbopack-next/dev/hmr-client";
|
||||
import { onUpdate } from "@vercel/turbopack-next/dev/hmr-client";
|
||||
|
||||
const pageChunkPath = location.pathname.slice(1);
|
||||
|
||||
onChunkUpdate(pageChunkPath, (update) => {
|
||||
if (update.type === "restart") {
|
||||
location.reload();
|
||||
onUpdate(
|
||||
{
|
||||
path: pageChunkPath,
|
||||
headers: {
|
||||
accept: "text/html",
|
||||
},
|
||||
},
|
||||
(update) => {
|
||||
if (update.type === "restart") {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
initializeHMR({
|
||||
assetPrefix: "",
|
||||
|
|
Loading…
Reference in a new issue