diff --git a/dist/functions/server/web-pages/grab-web-page-hydration-script.js b/dist/functions/server/web-pages/grab-web-page-hydration-script.js index 14788d1..9af6df9 100644 --- a/dist/functions/server/web-pages/grab-web-page-hydration-script.js +++ b/dist/functions/server/web-pages/grab-web-page-hydration-script.js @@ -12,9 +12,6 @@ export default async function (params) { const supress_condition = errors_to_supress .map((e) => `args[0].includes("${e}")`) .join(" || "); - const runtime_supress_condition = errors_to_supress - .map((e) => `message.includes("${e}")`) - .join(" || "); script += `const _ce = console.error.bind(console);\n`; script += `console.error = (...args) => {\n`; script += ` if (typeof args[0] === "string" && (${supress_condition})) return;\n`; @@ -30,7 +27,8 @@ export default async function (params) { script += ` document.body.appendChild(overlay);\n`; script += `}\n\n`; script += `function __bunext_should_suppress_runtime_error(message) {\n`; - script += ` return typeof message === "string" && (${runtime_supress_condition});\n`; + script += ` return false;\n`; + // script += ` return typeof message === "string" && (message.includes('Dynamic require of "react/jsx-dev-runtime"') || message.includes("react/jsx-dev-runtime"));\n`; script += `}\n\n`; script += `window.addEventListener("error", (e) => {\n`; script += ` const message = String(e.message ?? "");\n`; diff --git a/package.json b/package.json index 03e5461..515bb2a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@moduletrace/bunext", "module": "index.ts", "type": "module", - "version": "1.0.38", + "version": "1.0.39", "main": "dist/index.js", "types": "dist/index.d.ts", "exports": { diff --git a/src/functions/server/web-pages/grab-web-page-hydration-script.tsx b/src/functions/server/web-pages/grab-web-page-hydration-script.tsx index fb93f6c..530a42c 100644 --- a/src/functions/server/web-pages/grab-web-page-hydration-script.tsx +++ b/src/functions/server/web-pages/grab-web-page-hydration-script.tsx @@ -23,10 +23,6 @@ export default async function (params?: Params) { .map((e) => `args[0].includes("${e}")`) .join(" || "); - const runtime_supress_condition = errors_to_supress - .map((e) => `message.includes("${e}")`) - .join(" || "); - script += `const _ce = console.error.bind(console);\n`; script += `console.error = (...args) => {\n`; script += ` if (typeof args[0] === "string" && (${supress_condition})) return;\n`; @@ -43,7 +39,8 @@ export default async function (params?: Params) { script += ` document.body.appendChild(overlay);\n`; script += `}\n\n`; script += `function __bunext_should_suppress_runtime_error(message) {\n`; - script += ` return typeof message === "string" && (${runtime_supress_condition});\n`; + script += ` return false;\n`; + // script += ` return typeof message === "string" && (message.includes('Dynamic require of "react/jsx-dev-runtime"') || message.includes("react/jsx-dev-runtime"));\n`; script += `}\n\n`; script += `window.addEventListener("error", (e) => {\n`; script += ` const message = String(e.message ?? "");\n`;