|
| 1 | +# ADR 0008: Remove netlify-plugin-checklinks |
| 2 | + |
| 3 | +Date: 2026-05-19 |
| 4 | +Status: Accepted |
| 5 | +Branch: lb/myst-migration |
| 6 | + |
| 7 | +## Context |
| 8 | + |
| 9 | +`netlify-plugin-checklinks` v4.1.1 has been in `netlify.toml` since the |
| 10 | +initial Netlify setup. During the MyST migration CI run it produced three |
| 11 | +distinct failure categories: |
| 12 | + |
| 13 | +**Category 1 — Broken internal links (12 failures, genuine)** |
| 14 | +MyST's default flat-slug URL mode didn't match Hugo's hierarchical URLs. |
| 15 | +Fixed by moving `myst.yml` into `content/` and enabling `site.options.folders: |
| 16 | +true`. Checklinks correctly caught this problem. |
| 17 | + |
| 18 | +**Category 2 — ES2022 JS parse error (1 failure, false positive)** |
| 19 | +MyST bundles JavaScript using ES2022 class static initializer blocks |
| 20 | +(`StaticBlock`). The plugin's parser predates ES2022 and fails on this syntax. |
| 21 | +Hugo never copied JS bundles into `public/`, so this was never exposed before. |
| 22 | +The plugin is structurally incompatible with MyST's output without skipping |
| 23 | +the entire `public/build/` directory. |
| 24 | + |
| 25 | +**Category 3 — CDN ETIMEDOUT (3 failures, false positive)** |
| 26 | +Netlify's build sandbox cannot reach `cdn.jsdelivr.net`. MyST injects CDN |
| 27 | +references for katex (math rendering) and jupyter-matplotlib (widget CSS) |
| 28 | +into the built HTML; Hugo's theme did not. `unpkg.com` was already in |
| 29 | +`skipPatterns` for the same reason, indicating the CDN-blocking pattern was |
| 30 | +known. This requires an ever-growing skip list as MyST or the cookie submodule |
| 31 | +adds new CDN dependencies. |
| 32 | + |
| 33 | +The plugin itself is unmaintained: no releases since mid-2023, open issues |
| 34 | +about ES2022 parsing and Netlify network restrictions unaddressed. |
| 35 | + |
| 36 | +MyST's own build step (`myst build --html`) warns on broken cross-references |
| 37 | +during the build, covering the plugin's only validated use case (category 1). |
| 38 | +External CDN link checking is unreliable in the Netlify sandbox environment. |
| 39 | + |
| 40 | +Stephan (sp-org maintainer) has confirmed the plugin can be removed if it |
| 41 | +continues to be a headache. |
| 42 | + |
| 43 | +## Decision |
| 44 | + |
| 45 | +Remove `netlify-plugin-checklinks` from `netlify.toml`. |
| 46 | + |
| 47 | +Rely on `myst build` cross-reference warnings for internal link integrity. |
| 48 | +Do not replace with another link-checker at this time. |
| 49 | + |
| 50 | +## Options considered |
| 51 | + |
| 52 | +1. **Remove the plugin** — eliminates false positives; internal links still |
| 53 | + caught by `myst build`; CDN availability not checked (acceptable: CDNs |
| 54 | + have their own uptime monitoring). |
| 55 | +2. **Keep patching `skipPatterns`** — each MyST or cookie update may introduce |
| 56 | + new CDN or bundle paths requiring another skip; ongoing maintenance burden |
| 57 | + with no clear endpoint. |
| 58 | +3. **Replace with a different link-checker** — introduces new dependency; |
| 59 | + the same CDN-blocking and JS-parsing problems would likely recur; deferred |
| 60 | + unless a concrete need emerges post-merge. |
| 61 | + |
| 62 | +## Consequences |
| 63 | + |
| 64 | +- Netlify CI will pass without false positives from CDN timeouts or JS parse |
| 65 | + errors |
| 66 | +- Broken internal links are still caught: `myst build` emits warnings for |
| 67 | + unresolved cross-references; these become visible in the Netlify build log |
| 68 | +- External CDN availability is not verified in CI; this is acceptable since |
| 69 | + CDNs are monitored independently and failures are user-visible immediately |
| 70 | +- If a link-checker is wanted in future, `myst build --check` or a |
| 71 | + `htmltest`-based approach that understands modern JS would be more suitable |
| 72 | + than `netlify-plugin-checklinks` v4.1.1 |
0 commit comments