Skip to content

Commit d88c581

Browse files
authored
fix: ignore directive sourcemap error (#369)
1 parent 0f7684a commit d88c581

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/plugin-react/src/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,14 @@ const silenceUseClientWarning = (userConfig: UserConfig): BuildOptions => ({
326326
) {
327327
return
328328
}
329+
// https://github.com/vitejs/vite/issues/15012
330+
if (
331+
warning.code === 'SOURCEMAP_ERROR' &&
332+
warning.message.includes('resolve original location') &&
333+
warning.pos === 0
334+
) {
335+
return
336+
}
329337
if (userConfig.build?.rollupOptions?.onwarn) {
330338
userConfig.build.rollupOptions.onwarn(warning, defaultHandler)
331339
} else {

0 commit comments

Comments
 (0)