diff --git a/code/lib/csf-plugin/src/index.ts b/code/lib/csf-plugin/src/index.ts index 8204a1f723ac..d75d169b9c96 100644 --- a/code/lib/csf-plugin/src/index.ts +++ b/code/lib/csf-plugin/src/index.ts @@ -23,7 +23,11 @@ export const unplugin = createUnplugin((options) => { enrichCsf(csf, options); return formatCsf(csf); } catch (err: any) { - logger.warn(err.message); + // This can be called on legacy storiesOf files, so just ignore + // those errors. But warn about other errors. + if (!err.message?.startsWith('CSF:')) { + logger.warn(err.message); + } return code; } },