Skip to content

Commit

Permalink
[wrangler] fix: stop rebuild attempts when sources are missing (cloud…
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusdahlstrand committed Jan 30, 2024
1 parent ed40cf8 commit a8da1b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-files-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": minor
---

fix: Intermittent errors during watch rebuilds mitigated
10 changes: 8 additions & 2 deletions packages/wrangler/src/pages/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,10 @@ export const Handler = async ({
watch([workerScriptPath], {
persistent: true,
ignoreInitial: true,
}).on("all", async () => {
}).on("all", async (event) => {
if (event === "unlink") {
return;
}
await runBuild();
});
} else if (usingFunctions) {
Expand Down Expand Up @@ -539,8 +542,11 @@ export const Handler = async ({
watch([routesJSONPath], {
persistent: true,
ignoreInitial: true,
}).on("all", async () => {
}).on("all", async (event) => {
try {
if (event === "unlink") {
return;
}
/**
* Watch for _routes.json file changes and validate file each time.
* If file is valid proceed to running the build.
Expand Down

0 comments on commit a8da1b8

Please sign in to comment.