#2516·quartz

v5 upgrade guide: npm plugin specifier migration is not optional when legacy-peer-deps is set

Author: dwarak-shCreated Aug 1, 2026Updated Sep 27, 2026
Labelsbug

Describe the bug

docs/getting-started/upgrading.md describes the npm plugin-specifier migration as optional and states that github: specifiers continue to work. On an existing v5 site this is not true, because the same upgrade also introduces legacy-peer-deps=true into .npmrc.

github: sources are cloned and built from source. @quartz-community/syntax-highlighting declares shiki as a peerDependency, and with legacy-peer-deps=true npm does not install it, so the plugin's TypeScript build fails. The plugin is then skipped — but install-plugins and quartz build both exit 0, so the site ships silently without syntax highlighting.

To Reproduce

  1. Start from an existing v5 site whose quartz.config.yaml uses github:quartz-community/* plugin specifiers, including github:quartz-community/syntax-highlighting
  2. Merge current v5 (this brings legacy-peer-deps=true into .npmrc)
  3. Run npm ci
  4. Run npm run install-plugins
  5. See the build error and the skip warning below; note the exit code is 0
  6. Run npx quartz build — it also exits 0, with a lower page count than before

Expected behavior

Either github: specifiers keep working as the upgrade guide states, or the failure is loud — a non-zero exit, so a broken build cannot be deployed unnoticed.

Screenshots and Source

No public reproduction repo, but the failure output is deterministic:

> npx tsx ./quartz/plugins/loader/install-plugins.ts
src/token-classifier.ts(1,71): error TS2307: Cannot find module 'shiki'
⚠ Skipping syntax-highlighting: no dist/index.d.ts found
✓ Regenerated plugin index with 35 plugins

The resulting build emitted 801 files instead of 803, with no error and exit code 0.

Migrating the specifiers to npm form resolves it — npm-published plugins ship pre-built and need no peer resolution:

- source: github:quartz-community/syntax-highlighting
+ source: "@quartz-community/syntax-highlighting"

(Note that one package name differs from its repo name: github:quartz-community/fonts becomes @quartz-community/quartz-fonts.)

Desktop (please complete the following information):

  • Quartz Version: v5 branch, upstream tip 74b3fc9 (2026-07-30)
  • node Version: v22.23.1
  • npm version: 10.9.8
  • OS: Linux (Debian-based)
  • Browser: n/a — build-time issue

Additional context

Two suggestions, in order of confidence:

  1. The upgrade guide should state that the specifier migration is required, not optional, for anyone using github: specifiers with plugins that have peer dependencies — or that legacy-peer-deps=true breaks build-from-source plugin installs.

  2. Separately, a plugin failing to build and being skipped probably shouldn't leave a zero exit code. The skip is reported as a warning and the build succeeds, so the only symptom is a page count that quietly changes. In my case the site would have deployed without syntax highlighting and nothing would have flagged it.