Clean up circular imports fixes

This commit is contained in:
Nuckyz 2025-05-13 17:09:57 -03:00 committed by Vendicated
parent d542095993
commit 8c7225d106
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
3 changed files with 33 additions and 22 deletions

View file

@ -156,7 +156,14 @@ export function _blacklistBadModules(requireCache: NonNullable<AnyWebpackRequire
let hasOnlyBadProperties = true;
for (const exportKey in exports) {
if (shouldIgnoreValue(exports[exportKey])) {
// Some exports might have not been initialized yet due to circular imports, so try catch it.
try {
var exportValue = exports[exportKey];
} catch {
continue;
}
if (shouldIgnoreValue(exportValue)) {
makePropertyNonEnumerable(exports, exportKey);
} else {
hasOnlyBadProperties = false;