{"record":{"id":"628bf095fde193df","repo":"k1tbyte/Wand-Enhancer","slug":"enhancer-no-app-bundle-found","errorCode":null,"errorMessage":"[ENHANCER] No app bundle found","messagePattern":"\\[ENHANCER\\] No app bundle found","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"WandEnhancer/Core/Enhancer.cs","lineNumber":130,"sourceCode":"                    : patch.Target.Replace(js, patchSource);\n            }\n\n            _logger($\"{prefix} Patch applied\", ELogType.Success);\n            patch.Applied = true;\n            patchApplied = true;\n            \n            return newJs;\n        }\n\n        private void PatchAsar()\n        {\n            var items = Directory.EnumerateFiles(_unpackedPath, $\"*{JavaScriptFileExtension}\", SearchOption.TopDirectoryOnly)\n                .Where(IsCandidateBundleFile)\n                .ToList();\n\n            if (!items.Any())\n            {\n                throw new Exception(\"[ENHANCER] No app bundle found\");\n            }\n            \n            var remainingPatches = new HashSet<EPatchType>(_config.PatchTypes);\n            var enhancerConfig = EnhancerConfig.GetInstance();\n\n            foreach (var item in items)\n            {\n                if (remainingPatches.Count == 0)\n                {\n                    break;\n                }\n\n                if (!CouldFileContainRemainingPatch(item, remainingPatches, enhancerConfig))\n                {\n                    continue;\n                }\n                \n                string data = File.ReadAllText(item);","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/k1tbyte/Wand-Enhancer/blob/643c8f8b62cbb26fd3ac105b92497d9a9c445f08/WandEnhancer/Core/Enhancer.cs#L112-L148","documentation":"PatchAsar enumerates top-level .js files under _unpackedPath (resources/app.asar.unpacked) and filters via IsCandidateBundleFile, which accepts only index.js or files matching app-*.bundle.js. If nothing passes, there is no bundle to patch and the process aborts.","triggerScenarios":"PatchAsar() at Enhancer.cs:124-131 after AsarExtractor.ExtractAll ran: Directory.EnumerateFiles(_unpackedPath, \"*.js\", TopDirectoryOnly).Where(IsCandidateBundleFile) yields an empty list.","commonSituations":"Extraction produced an empty or partial _unpackedPath (see [11]); Wand renamed/relocated its bundle filename convention; the asar header pointed at a non-standard layout; antivirus quarantined the extracted bundles.","solutions":["Open resources/app.asar.unpacked and confirm it actually contains extracted files.","Verify AsarExtractor.ExtractAll completed without throwing (check [11]).","List the real bundle filenames; if Wand changed convention (no longer index.js / app-*.bundle.js), update IsCandidateBundleFile's constants (IndexBundleFileName / AppBundleFilePrefix / AppBundleFileSuffix).","If the dir is empty/corrupt, reinstall Wand to a known-good state, delete app.asar.backup + app.asar.unpacked.backup, and re-patch."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify a candidate bundle exists before patching\nvar candidates = Directory.EnumerateFiles(_unpackedPath, \"*.js\", SearchOption.TopDirectoryOnly)\n    .Where(f => f.EndsWith(\"index.js\", StringComparison.OrdinalIgnoreCase)\n             || (Path.GetFileName(f).StartsWith(\"app-\", StringComparison.OrdinalIgnoreCase)\n                 && Path.GetFileName(f).EndsWith(\".bundle.js\", StringComparison.OrdinalIgnoreCase)));\nif (!candidates.Any())\n    throw new InvalidOperationException(\"No candidate bundle in \" + _unpackedPath + \"; extraction may have failed.\");","typeGuard":null,"tryCatchPattern":"try { enhancer.Patch(); }\ncatch (Exception ex) when (ex.Message == \"[ENHANCER] No app bundle found\") {\n    // inspect _unpackedPath, confirm extraction, then reinstall/re-extract\n}","preventionTips":["After extraction, log the file count and names under _unpackedPath.","Treat an empty extraction as a hard stop before PatchAsar runs.","Keep bundle-name constants in sync with Wand releases."],"tags":["asar","extraction","filesystem","bundle"],"backgroundTag":null,"analyzedSha":"643c8f8b62cbb26fd3ac105b92497d9a9c445f08","analyzedAt":"2026-08-13T14:17:43.823Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}