From 680f42280e2231d1963671e06c61fcd88641919b Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Wed, 18 Dec 2024 09:45:22 -0800 Subject: [PATCH] fix types --- cli/src/commands/dev/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/src/commands/dev/index.ts b/cli/src/commands/dev/index.ts index 558264130..eeda8d084 100644 --- a/cli/src/commands/dev/index.ts +++ b/cli/src/commands/dev/index.ts @@ -215,7 +215,10 @@ export default class DevCommand extends BaseCommand { // Whenever any of the env files change, copy to the build directory. // The runtime will automatically reload them when it detects a change to the copies in the build folder. - const onAddOrChange = async (sourcePath: string) => { + const onAddOrChange = async (sourcePath: string | Error) => { + if (sourcePath instanceof Error) { + return; + } const filename = path.basename(sourcePath); const outputPath = path.join(appPath, "build", filename); try { @@ -245,6 +248,9 @@ export default class DevCommand extends BaseCommand { .on("add", onAddOrChange) .on("change", onAddOrChange) .on("unlink", async (sourcePath) => { + if (sourcePath instanceof Error) { + return; + } const filename = path.basename(sourcePath); const outputPath = path.join(appPath, "build", filename); try {