fix: use real 500 error page in dev mode (#2134)

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit is contained in:
Christian Svensson
2023-12-04 12:06:06 +01:00
committed by GitHub
co-authored by Marvin Hagemeister
parent e78c6a90af
commit c4e09d1cef
7 changed files with 19 additions and 27 deletions
+5 -2
View File
@@ -359,9 +359,12 @@ export async function render<Data>(
pluginRenderResults: renderResults,
});
// Append error overlay
// Dev only: Append error overlay
const devErrorUrl = withBase(DEV_ERROR_OVERLAY_URL, basePath);
if (error !== undefined && url.pathname !== devErrorUrl) {
if (
error !== undefined && url.pathname !== devErrorUrl &&
opts.context.config.dev
) {
const url = new URL(devErrorUrl, "https://localhost/");
if (error instanceof Error) {
let message = error.message;