Skip to content

Commit 0fad35b

Browse files
Copilothotlong
andcommitted
refine sourcemap warning filter to use exact message match instead of broad pattern
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent cea10ff commit 0fad35b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.storybook/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,12 @@ const config: StorybookConfig = {
8484
target: 'esnext',
8585
rollupOptions: {
8686
onwarn(warning, warn) {
87-
// Suppress "use client" directive warnings and sourcemap resolution errors
88-
if (warning.code === 'MODULE_LEVEL_DIRECTIVE' || warning.message?.includes('sourcemap')) {
87+
// Suppress "use client" directive warnings (from Radix UI, react-router, etc.)
88+
// and sourcemap resolution errors from dependencies with incomplete sourcemaps
89+
if (
90+
warning.code === 'MODULE_LEVEL_DIRECTIVE' ||
91+
warning.message?.includes("Can't resolve original location of error")
92+
) {
8993
return;
9094
}
9195
warn(warning);

0 commit comments

Comments
 (0)