Skip to content

Fix compare-screenshots failure on Deno 2.8.3: pngjs -> fast-png#3945

Merged
Nateowami merged 1 commit into
masterfrom
fix/compare-screenshots-png
Jun 11, 2026
Merged

Fix compare-screenshots failure on Deno 2.8.3: pngjs -> fast-png#3945
Nateowami merged 1 commit into
masterfrom
fix/compare-screenshots-png

Conversation

@Nateowami

@Nateowami Nateowami commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

This has started to cause all PRs to fail.

This change is Reviewable

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.67%. Comparing base (cdef970) to head (d6e9468).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3945   +/-   ##
=======================================
  Coverage   80.67%   80.67%           
=======================================
  Files         634      634           
  Lines       40995    40995           
  Branches     6650     6650           
=======================================
  Hits        33073    33073           
  Misses       6884     6884           
  Partials     1038     1038           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Nateowami Nateowami force-pushed the fix/compare-screenshots-png branch from 9f8e84c to 3e69835 Compare June 11, 2026 19:29
@Nateowami Nateowami temporarily deployed to screenshot_diff June 11, 2026 19:35 — with GitHub Actions Inactive

@RaymondLuong3 RaymondLuong3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RaymondLuong3 reviewed 1 file and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on Nateowami).


scripts/storybook-screenshots/compare-screenshots.mts line 39 at r1 (raw file):

import { join } from 'node:path';
// fast-png uses fflate (pure JS) for decompression. pngjs uses Node's zlib, which broke under a
// Deno 2.x update that tightened type-checking in its Node compat zlib binding.

Is that supposed to be node compact?

Code quote:

type-checking in its Node compat 

scripts/storybook-screenshots/compare-screenshots.mts line 106 at r1 (raw file):

function countDifferingPixels(a: DecodedPng, b: DecodedPng, threshold: number): number {
  if (a.width !== b.width || a.height !== b.height || a.channels !== b.channels) return -1;
  const ch = a.channels;

It looks like we don't expect the image to have 3 or 4 channels. Why is that so? It looks like it was a change in how the PNG is decoded.

Code quote:

  const ch = a.channels;

@RaymondLuong3 RaymondLuong3 self-assigned this Jun 11, 2026

@Nateowami Nateowami left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nateowami made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on RaymondLuong3).


scripts/storybook-screenshots/compare-screenshots.mts line 39 at r1 (raw file):

Previously, RaymondLuong3 (Raymond Luong) wrote…

Is that supposed to be node compact?

Deno has a compatibility layer to work with Node bindings.


scripts/storybook-screenshots/compare-screenshots.mts line 106 at r1 (raw file):

Previously, RaymondLuong3 (Raymond Luong) wrote…

It looks like we don't expect the image to have 3 or 4 channels. Why is that so? It looks like it was a change in how the PNG is decoded.

We expect image a and image b to have the same number of channels. If they don't, it's hard to meaningfully compare.

@Nateowami Nateowami force-pushed the fix/compare-screenshots-png branch from 3e69835 to d6e9468 Compare June 11, 2026 20:09

@Nateowami Nateowami left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nateowami made 1 comment.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on RaymondLuong3).


scripts/storybook-screenshots/compare-screenshots.mts line 39 at r1 (raw file):

Previously, Nateowami wrote…

Deno has a compatibility layer to work with Node bindings.

Historical not is probably not really warranted. Removed.

@Nateowami Nateowami enabled auto-merge (squash) June 11, 2026 20:11

@Nateowami Nateowami left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nateowami made 1 comment.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on RaymondLuong3).


scripts/storybook-screenshots/compare-screenshots.mts line 39 at r1 (raw file):

Previously, Nateowami wrote…

Historical not is probably not really warranted. Removed.

*Historical note

@Nateowami Nateowami temporarily deployed to screenshot_diff June 11, 2026 20:16 — with GitHub Actions Inactive

@RaymondLuong3 RaymondLuong3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RaymondLuong3 reviewed 1 file and all commit messages, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Nateowami).

@Nateowami Nateowami merged commit aeadd17 into master Jun 11, 2026
25 of 26 checks passed
@Nateowami Nateowami deleted the fix/compare-screenshots-png branch June 11, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants