Rewrite WebpackPatcher to support new features (#3157)

This commit is contained in:
Nuckyz 2025-02-07 20:07:17 -03:00 committed by GitHub
parent fcf8690d26
commit e8639e2e16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 896 additions and 358 deletions

View file

@ -215,7 +215,7 @@ page.on("console", async e => {
switch (tag) {
case "WebpackInterceptor:":
const patchFailMatch = message.match(/Patch by (.+?) (had no effect|errored|found no module) \(Module id is (.+?)\): (.+)/)!;
const patchFailMatch = message.match(/Patch by (.+?) (had no effect|errored|found no module|took [\d.]+?ms) \(Module id is (.+?)\): (.+)/)!;
if (!patchFailMatch) break;
console.error(await getText());
@ -226,7 +226,7 @@ page.on("console", async e => {
plugin,
type,
id,
match: regex.replace(/\(\?:\[A-Za-z_\$\]\[\\w\$\]\*\)/g, "\\i"),
match: regex,
error: await maybeGetError(e.args()[3])
});
@ -292,7 +292,7 @@ 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")) {
if (!e.message.startsWith("Object") && !e.message.includes("Cannot find module") && !/^.{1,2}$/.test(e.message)) {
console.error("[Page Error]", e.message);
report.otherErrors.push(e.message);
} else {