k1tbyte/Wand-Enhancer · error · FileNotFoundException
[ENHANCER] Remote bridge artifact is missing. Run `cd web-pa
Error message
[ENHANCER] Remote bridge artifact is missing. Run `cd web-panel && pnpm run build` before patching.
What it means
After copying embedded remote-panel resources (or the workspace web-panel/dist fallback), the bridge artifact bridge.cjs must exist at <_unpackedPath>/remote-panel/bridge.cjs. Its absence means the Electron main-process bridge was never built. The bridge is the runtime hook that installs the remote panel into Wand's process.
Source
Thrown at WandEnhancer/Core/Enhancer.cs:404
string localCustomScriptsRoot = FindLocalCustomScriptsPath();
string targetRoot = Path.Combine(_unpackedPath, RemotePanelDirectoryName);
string targetScriptsRoot = Path.Combine(targetRoot, RemoteRendererScriptsDirectoryName);
string targetBridgePath = Path.Combine(targetRoot, RemoteBridgeTargetFileName);
if (Directory.Exists(targetRoot))
{
Directory.Delete(targetRoot, true);
}
if (CopyEmbeddedDirectory(EmbeddedRemotePanelDistPrefix, targetRoot) == 0)
{
CopyDirectory(FindWorkspacePath(WebPanelDirectoryName, WebPanelDistDirectoryName), targetRoot);
}
if (!File.Exists(targetBridgePath))
{
throw new FileNotFoundException("[ENHANCER] Remote bridge artifact is missing. Run `cd web-panel && pnpm run build` before patching.", targetBridgePath);
}
int defaultScriptCount = Directory.Exists(targetScriptsRoot)
? Directory.GetFiles(targetScriptsRoot, JavaScriptFileSearchPattern, SearchOption.TopDirectoryOnly).Length
: 0;
if (defaultScriptCount == 0)
{
throw new FileNotFoundException("[ENHANCER] Remote renderer script artifacts are missing. Run `cd web-panel && pnpm run build` before patching.", targetScriptsRoot);
}
int selectedScriptCount = CopySelectedJavaScriptFiles(_config.CustomScriptPaths, targetScriptsRoot);
int localScriptCount = CopyJavaScriptFiles(localCustomScriptsRoot, targetScriptsRoot);
_logger($"[ENHANCER] Injected remote panel assets and renderer scripts into app.asar (default: {defaultScriptCount}, selected: {selectedScriptCount}, local: {localScriptCount})", ELogType.Info);
}
private void AttachProxyDll()
{View on GitHub (pinned to 643c8f8b62)
Solutions
- Run `cd web-panel && pnpm run build` (per AGENTS.md this runs type-check, Vite build, then build:bridge into dist).
- Verify web-panel/dist/bridge.cjs exists and `node --check web-panel/dist/bridge.cjs` passes.
- Ensure the .csproj embeds remote-panel/dist OR run the patcher from the repo root.
- Delete resources/app.asar.backup + app.asar.unpacked.backup and re-patch so a fresh extraction picks up the new dist.
Defensive patterns
Strategy: validation
Validate before calling
// Confirm bridge.cjs is buildable/present before patching
string bridgeDist = Path.Combine(repoRoot, "web-panel", "dist", "bridge.cjs");
bool embedded = Assembly.GetExecutingAssembly().GetManifestResourceNames()
.Any(n => n.Equals("remote-panel/dist/bridge.cjs", StringComparison.Ordinal));
if (!embedded && !File.Exists(bridgeDist))
throw new InvalidOperationException("bridge.cjs missing; run `cd web-panel && pnpm run build`."); Try / catch
try { enhancer.Patch(); }
catch (FileNotFoundException ex) when (ex.Message.Contains("Remote bridge artifact is missing")) {
// run pnpm build, then re-patch
} Prevention
- Run `pnpm run build` as a pre-build step of the C# project.
- Gate the patch button in the UI on bridge.cjs existence.
- Always embed dist in shipped binaries.
When it happens
Trigger: InjectRemotePanelFiles at Enhancer.cs:402-405 with EPatchType.RemoteWebPanelPreview enabled: after CopyEmbeddedDirectory + CopyDirectory, File.Exists(targetBridgePath) is false where targetBridgePath = Path.Combine(targetRoot, "bridge.cjs").
Common situations: Developer ran the patcher without first running `pnpm run build:bridge`; web-panel/dist is stale or empty; the bridge output path moved in the vite/bridge config; the .csproj did not embed remote-panel/dist so it relied on the missing workspace fallback.
Related errors
- [ENHANCER] Remote renderer script artifacts are missing. Run
- Required workspace artifact not found: {Path.Combine(segment
- Embedded resource not found: {resourceName}
- [ENHANCER] Proxy DLL resource not found
AI-assisted analysis of k1tbyte/Wand-Enhancer@643c8f8b62 (2026-08-13).
Data as JSON: /api/errors/14d01cba0a206187.
Report an issue: GitHub.