You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: every ASAR analysis fails with artifact_operation_failed (platform path separators not handled in AsarArtifactReader) #570
On Windows, analyze_javascript_application (and rea analyze) fails for every.asar with:
{
"code": "artifact_operation_failed",
"category": "execution_failure",
"message": "Artifact is invalid or has changed. Get a fresh copy and try again.",
"details": { "operation": "analyze_javascript_application", "reason": "format" }
}
The archive is valid — npx @electron/asar list app.asar enumerates all entries fine. No valid ASAR can be analyzed on Windows.
listPackage (line 30) returns entry paths using the platform separator, with a leading separator — on Windows: \node_modules, \node_modules\@formatjs, …
Line 34 strips only forward slashes:
constpath=listed.replace(/^\/+|\/+$/gu,"");
so on Windows the leading \ survives (\node_modules).
Line 38 passes that key to statFile(this.path, path, false). @electron/asar's Filesystem.getFile splits lookup keys on path.sep (\ on Windows), so the key \node_modules resolves to an empty first component and fails with '"\node_modules" was not found in this archive'. asarFailure wraps this into a format failure, which surfaces as the generic artifact_operation_failed above.
adapterKey (line 69) keeps the same malformed key, so extractFile would fail the same way.
On macOS/Linux listPackage emits /node_modules/..., the regex strips the leading /, and lookups succeed — hence Windows-only.
Fix
Normalize separators and use path.sep for @electron/asar lookups while keeping graph-facing paths POSIX. The following patch (applied to the installed dist) was verified: rea analyze on a real 118 MB Electron app.asar proceeds past inventory and completes:
Related observation (separate cause, also blocks Windows use)
rea doctor --json fails on Windows with spawn EINVAL: RuntimeExecutableDiagnostics discovers .CMD/.BAT candidates (npm.cmd, npx.cmd) on PATH and spawns them without shell, which Node.js (≥20.12) rejects with EINVAL. Diagnostics-only, but it hides the capability matrix on Windows.
Activity