Skip to content

Commit 4f350a4

Browse files
Mkassabovsam-goodwin
authored andcommitted
fix(cloudflare): prevent esbuild errors from crashing reload (#1170)
1 parent 9c91428 commit 4f350a4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

alchemy/src/cloudflare/worker-bundle.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,14 @@ export namespace WorkerBundleSource {
308308

309309
for await (const result of hotReload.iterator) {
310310
count++;
311+
if (result.errors.length > 0 || result.metafile == null) {
312+
logger.error(
313+
`Error bundling worker \`${this.props.id}\`, see detailed logs above.`,
314+
);
315+
continue;
316+
}
311317
const { entrypoint, root, modules } = await this.formatBuildOutput(
312-
result.metafile!,
318+
result.metafile,
313319
);
314320
yield {
315321
entrypoint,

0 commit comments

Comments
 (0)