diff --git a/snowpack/src/commands/build.ts b/snowpack/src/commands/build.ts index fc76ce597f..e5ca2e9cd6 100644 --- a/snowpack/src/commands/build.ts +++ b/snowpack/src/commands/build.ts @@ -222,7 +222,11 @@ export async function build(commandOptions: CommandOptions): Promise {}; devServer.onFileChange(async ({filePath}) => { // First, do our own re-build logic - allFileUrlsToProcess.push(...getUrlsForFile(filePath, config)!); + const fileUrls = getUrlsForFile(filePath, config); + if (!fileUrls || fileUrls.length === 0) { + return; + } + allFileUrlsToProcess.push(fileUrls[0]); await flushFileQueue(false, { isSSR, isHMR,