Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update transform error message #14139

Merged
merged 6 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
return
}
// Unexpected error, log the issue but avoid an unhandled exception
config.logger.error(e.message, { error: e })
config.logger.error(`Pre-transform error: ${e.message}`, {
error: e,
timestamp: true,
})
})
}
} else if (!importer.startsWith(withTrailingSlash(clientDir))) {
Expand Down
5 changes: 4 additions & 1 deletion packages/vite/src/node/server/middlewares/indexHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ function preTransformRequest(server: ViteDevServer, url: string, base: string) {
return
}
// Unexpected error, log the issue but avoid an unhandled exception
server.config.logger.error(e.message)
server.config.logger.error(`Pre-transform error: ${e.message}`, {
error: e,
timestamp: true,
btea marked this conversation as resolved.
Show resolved Hide resolved
})
})
}