Skip to content

pixelmatch must be installed manually — should be declared as peerDependency #58

Description

@matus-sabo

Problem

The quickpickle package (v1.11.1) imports pixelmatch in its distributed bundle:

  • dist/index.esm.js: import pixelmatch from 'pixelmatch'
  • dist/index.cjs: var pixelmatch = require('pixelmatch')
  • dist/world.d.ts: import { type PixelmatchOptions } from 'pixelmatch'

However, pixelmatch is not listed in dependencies or peerDependencies in packages/main/package.json. This means running quickpickle without explicitly adding pixelmatch to your own project fails at runtime.

Steps to reproduce

  1. Install quickpickle without pixelmatch:
   npm install --save-dev quickpickle vitest
  1. Run tests — they fail with a module-not-found error for pixelmatch.

Expected behavior

pixelmatch should be declared as

  • peerDependency — PixelmatchOptions type is being used in quickpickle options type

Actual behavior

Consumers must manually add pixelmatch to their own devDependencies to avoid a runtime error, even when they don't use screenshot comparison functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions