Handle errors better

This commit is contained in:
2026-04-09 18:01:29 +01:00
parent eb0721f94b
commit f3b087a1f3
10 changed files with 91 additions and 15 deletions
+7 -1
View File
@@ -47,7 +47,13 @@ export default async function watcherEsbuildCTX() {
if (filename.match(/.*\.server\.tsx?/)) {
global.IS_SERVER_COMPONENT = true;
}
await global.BUNDLER_CTX?.rebuild();
if (global.BUNDLER_CTX && !global.BUNDLER_CTX_DISPOSED) {
await global.BUNDLER_CTX.rebuild();
}
else {
await fullRebuild({ msg: `Restarting Bundler ...` });
global.BUNDLER_CTX_DISPOSED = false;
}
if (filename.match(/(404|500)\.tsx?/)) {
for (let i = global.HMR_CONTROLLERS.length - 1; i >= 0; i--) {
const controller = global.HMR_CONTROLLERS[i];