This commit is contained in:
Nuckyz 2023-11-25 22:01:33 -03:00
parent 3a0aae0ec0
commit 717b400f2e
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -201,13 +201,11 @@ export const findBulk = traceFunction("findBulk", function findBulk(...filterFns
if (found !== length) { if (found !== length) {
const err = new Error(`Got ${length} filters, but only found ${found} modules!`); const err = new Error(`Got ${length} filters, but only found ${found} modules!`);
if (IS_DEV) { logger.warn(err);
logger.warn(err);
if (!devToolsOpen) // Strict behaviour in DevBuilds to fail early and make sure the issue is found
// Strict behaviour in DevBuilds to fail early and make sure the issue is found if (IS_DEV && !devToolsOpen)
throw err; throw err;
}
} }
return results; return results;
@ -229,13 +227,11 @@ export const findModuleId = traceFunction("findModuleId", function findModuleId(
} }
const err = new Error("Didn't find module with code(s):\n" + code.join("\n")); const err = new Error("Didn't find module with code(s):\n" + code.join("\n"));
if (IS_DEV) { logger.warn(err);
logger.warn(err);
if (!devToolsOpen) // Strict behaviour in DevBuilds to fail early and make sure the issue is found
// Strict behaviour in DevBuilds to fail early and make sure the issue is found if (IS_DEV && !devToolsOpen)
throw err; throw err;
}
return null; return null;
}); });
@ -385,14 +381,13 @@ export async function extractAndLoadChunks(code: string[], matcher: RegExp) {
const match = module.toString().match(matcher); const match = module.toString().match(matcher);
if (!match) { if (!match) {
if (IS_DEV) { const err = new Error("extractAndLoadChunks: Couldn't find entry point id in module factory code");
const err = new Error("extractAndLoadChunks: Couldn't find entry point id in module factory code"); logger.warn(err);
logger.warn(err, "Code:", code.join(", "), "Matcher:", matcher);
// Strict behaviour in DevBuilds to fail early and make sure the issue is found
if (IS_DEV && !devToolsOpen)
throw err;
if (!devToolsOpen)
// Strict behaviour in DevBuilds to fail early and make sure the issue is found
throw err;
}
return; return;
} }