From 7221fbcd3b32551bbe90fa080a1207cf57dc5e9c Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:42:27 -0400 Subject: [PATCH] Testing --- scripts/generateReport.ts | 11 +---------- src/debug/loadLazyChunks.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/scripts/generateReport.ts b/scripts/generateReport.ts index 2639d29d..6c1a94ab 100644 --- a/scripts/generateReport.ts +++ b/scripts/generateReport.ts @@ -288,16 +288,7 @@ page.on("console", async e => { }); page.on("error", e => console.error("[Error]", e.message)); -page.on("pageerror", e => { - if (e.message.includes("Sentry successfully disabled")) return; - - if (!e.message.startsWith("Object") && !e.message.includes("Cannot find module")) { - console.error("[Page Error]", e.message); - report.otherErrors.push(e.message); - } else { - report.ignoredErrors.push(e.message); - } -}); +page.on("pageerror", e => console.error("[Page Error]", e.message)); async function reporterRuntime(token: string) { Vencord.Webpack.waitFor( diff --git a/src/debug/loadLazyChunks.ts b/src/debug/loadLazyChunks.ts index 64c3e0ea..81dc53f0 100644 --- a/src/debug/loadLazyChunks.ts +++ b/src/debug/loadLazyChunks.ts @@ -47,11 +47,11 @@ export async function loadLazyChunks() { for (const id of chunkIds) { if (wreq.u(id) == null || wreq.u(id) === "undefined.js") continue; - const isWorkerAsset = await fetch(wreq.p + wreq.u(id)) + const isWasm = await fetch(wreq.p + wreq.u(id)) .then(r => r.text()) - .then(t => t.includes("importScripts(")); + .then(t => (IS_WEB && t.includes(".module.wasm")) || !t.includes("(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push")); - if (isWorkerAsset) { + if (isWasm && IS_WEB) { invalidChunks.add(id); invalidChunkGroup = true; continue; @@ -149,12 +149,12 @@ export async function loadLazyChunks() { }); await Promise.all(chunksLeft.map(async id => { - const isWorkerAsset = await fetch(wreq.p + wreq.u(id)) + const isWasm = await fetch(wreq.p + wreq.u(id)) .then(r => r.text()) - .then(t => t.includes("importScripts(")); + .then(t => (IS_WEB && t.includes(".module.wasm")) || !t.includes("(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push")); // Loads and requires a chunk - if (!isWorkerAsset) { + if (isWasm) { await wreq.e(id as any); // Technically, the id of the chunk does not match the entry point // But, still try it because we have no way to get the actual entry point