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
Commit f4f5ccc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cli): snapshot --against survives a sharp that cannot load
On Windows 11 with Smart App Control on, Code Integrity refuses sharp's
unsigned libvips DLL. With `--against`, the per-frame render | reference
pair sheet called sharp unguarded, so a blocked sharp failed the whole
snapshot with sharp's multi-line error dump, after the first frame.
Guard the pair sheet: a sharp load failure prints one warning, later
frames skip their pair sheet without retrying, and every frame and
reference frame is still written. Any other pair-sheet error still fails
the snapshot. captureSnapshots reports the skip, so the summary lists
only ref-*.png when no pair sheets were made.
describeSharpLoadFailure turns sharp's load error into one line and names
Windows App Control for Win32 error 4551 ("An Application Control policy
has blocked this file"). The contact-sheet warning keeps warning on every
failure and uses it to shorten sharp's message, and --describe no longer
tells the user to install a sharp that is installed but blocked.
Refs #4845
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JSZqP4FbpqviXu9v2LjBwE
'Could not load the "sharp" module using the win32-x64 runtime',
44
+
);
45
+
});
46
+
47
+
it("finds sharp's error inside the CLI's own could-not-load wrapper",()=>{
48
+
consterr=newError(
49
+
`contact sheets needs sharp, which is installed but could not load (${sharpLoadError("ERR_DLOPEN_FAILED: The specified module could not be found.").message}). Reinstall hyperframes with optional dependencies enabled, or run: npm i sharp`,
50
+
);
51
+
expect(describeSharpLoadFailure(err)).toBe(
52
+
'Could not load the "sharp" module using the win32-x64 runtime (ERR_DLOPEN_FAILED: The specified module could not be found.)',
53
+
);
54
+
});
55
+
56
+
it("ignores errors that are not a failed sharp load",()=>{
57
+
expect(describeSharpLoadFailure(newError("ENOENT: no such file"))).toBeNull();
58
+
expect(describeSharpLoadFailure("Input file is missing")).toBeNull();
return"Windows App Control (Smart App Control or an App Control policy) blocked sharp's unsigned native library. Smart App Control cannot allow a single file";
0 commit comments