Skip to content

Commit

Permalink
fix: ignore directive sourcemap error (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Sep 25, 2024
1 parent 0f7684a commit d88c581
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ const silenceUseClientWarning = (userConfig: UserConfig): BuildOptions => ({
) {
return
}
// https://github.com/vitejs/vite/issues/15012
if (
warning.code === 'SOURCEMAP_ERROR' &&
warning.message.includes('resolve original location') &&
warning.pos === 0
) {
return
}
if (userConfig.build?.rollupOptions?.onwarn) {
userConfig.build.rollupOptions.onwarn(warning, defaultHandler)
} else {
Expand Down

0 comments on commit d88c581

Please sign in to comment.