fix(vite): source mapping locations (#3624)
Mappings were wrong for a few reasons: - Missing source map generation in one babel transform - setting `compact: false` causes vite to generate incorrect mappings in `vite:import-analysis` - stack traces need to be mapped by vite Fixes https://github.com/denoland/fresh/issues/3609
This commit is contained in:
@@ -91,6 +91,7 @@ export type MaybeLazyMiddleware<State> = (
|
||||
export async function runMiddlewares<State>(
|
||||
middlewares: MaybeLazyMiddleware<State>[],
|
||||
ctx: Context<State>,
|
||||
onError?: (err: unknown) => void,
|
||||
): Promise<Response> {
|
||||
return await tracer.startActiveSpan("middlewares", {
|
||||
attributes: { "fresh.middleware.count": middlewares.length },
|
||||
@@ -117,7 +118,13 @@ export async function runMiddlewares<State>(
|
||||
|
||||
return result;
|
||||
} catch (err) {
|
||||
ctx.error = err;
|
||||
if (ctx.error !== err) {
|
||||
ctx.error = err;
|
||||
|
||||
if (onError !== undefined) {
|
||||
onError(err);
|
||||
}
|
||||
}
|
||||
throw err;
|
||||
} finally {
|
||||
internals.app = prevApp;
|
||||
|
||||
Reference in New Issue
Block a user