Skip to content

The documentation platform has never built: four stacked failures and nothing in CI runs the build #317

Closed

Description

@scttfrdmn

The documentation platform in docs-platform/ cannot be built. npm run build:docs (vitepress build) fails on unmodified main, and it fails for at least four independent reasons stacked behind each other — each one only becomes visible after the one in front of it is fixed. Nothing in CI or the Makefile runs it, which is why none of this has ever been reported.

This is the same class of defect as #314 (the JavaScript SDK's 48 tsc errors): a build target that nothing executes, so it is free to rot indefinitely while looking fine.

How it was found

While closing the three vite Dependabot alerts, I tried to confirm the bump didn't regress the docs build — and discovered there was no working build to regress. Reproduced in a scratch copy of docs-platform/ with unmodified package.json:

$ npx vitepress build
✘ [ERROR] "vitepress" resolved to an ESM file. ESM file cannot be loaded by `require`.
  [plugin externalize-deps]

The four faults, in the order they surface

1. No "type": "module" in docs-platform/package.json. vitepress is ESM-only, and vite 5 loads the config through require. This is the error above.

2. .vitepress/config.js is CommonJS. Adding "type": "module" to fix (1) makes Node treat every .js file in the directory as ESM, and the config uses require(). So the two faults are mutually exclusive under one fix: "type": "module" needs the config converted to import/export, or the config renamed to .mjs/.mts.

3. markdown-it-container cannot be required from the bundled config. With "type": "module" in place, the next failure is Dynamic require of ".../markdown-it-container/index.js" is not supported — esbuild bundles the config and the CJS dependency's require does not survive it.

4. Three of the five theme components do not exist. .vitepress/theme/index.js imports:

import ApiPlayground from '../components/ApiPlayground.vue'
import CodeRunner from '../components/CodeRunner.vue'
import InteractiveExample from '../components/InteractiveExample.vue'
import PerformanceChart from '../components/PerformanceChart.vue'
import ConfigurationBuilder from '../components/ConfigurationBuilder.vue'

.vitepress/components/ contains only ApiPlayground.vue and CodeRunner.vue. InteractiveExample.vue, PerformanceChart.vue and ConfigurationBuilder.vue do not exist anywhere in the repository — not under another name, not in another directory. This one cannot be fixed by configuration; the components have to be written or the imports removed.

Behind those four there is at least one more layer: with vite overridden to 6.x (which resolves fault 1 on its own, since vite 6 loads ESM configs), the build advances all the way to page compilation and then fails on README.md:166 with SyntaxError: [plugin vite:vue] Invalid end tag. docs-platform/README.md is a developer README that is being fed to the site compiler as a content page, because there is no srcExclude in the config. So the page set itself is wrong, independently of the module system.

Also broken in the same directory

  • npm run build is build:docs && build:client, and build:client is vite build client. There is no client/ directory. So even a fixed build:docs leaves npm run build failing on the next line. Either the directory was never committed or the script is vestigial.
  • package.json declares "main": "src/server.js" and a test script of jest with no test files.

Why it matters

Two reasons beyond the obvious:

  1. The vite security work cannot be verified end to end. The overrides block added for alerts 1–3 is verified by npm audit and by module loading, because there is no successful build to compare against. A build that ran in CI would have made that a stronger claim.
  2. The docs platform is a source of documentation overclaims (see the Part 4 audit notes): docs-platform/index.md:278-293 renders a performance chart from hardcoded arrays, and :45 claims GDPR/HIPAA/SOC2 compliance. A build nobody runs is also a page nobody reads critically.

Fix order

  1. Add vitepress build (or the whole npm run build) to a CI job so the failure is visible and cannot regress silently. Expect it red.
  2. Decide whether the platform is maintained at all. It is plausible that the right resolution is to delete docs-platform/ in favour of the MkDocs site, in which case steps 3–6 are moot and the three vite/uuid overrides go with it. That decision should be made before anyone writes three Vue components.
  3. If kept: rename .vitepress/config.js → config.mts and add "type": "module", resolving faults 1–3 together.
  4. Add srcExclude: ['README.md'] (and audit what else in the tree is being treated as a page).
  5. Write or delete InteractiveExample.vue, PerformanceChart.vue, ConfigurationBuilder.vue. If PerformanceChart is the component behind the hardcoded-array chart, deleting it is the better fix, and it overlaps with the fabricated-performance-data cleanup.
  6. Fix or remove build:client and the missing client/ directory.

Activity

  1. added
    type: bug
    priority: medium
    area: docs
    area: ci-cd
    on Aug 3, 2026
  2. scttfrdmn commented on Aug 4, 2026

    @scttfrdmn
    OwnerAuthor

    All four faults are resolved, and the gate this issue asks for exists. Verified on main at ee952e7 rather than inferred from the PRs:

    $ cd docs-platform && npx vitepress build .
    ✓ building client + server bundles...
    ✓ rendering pages...
    build complete in 1.82s.
    

    Worth recording that the four faults as filed are not the three that #334 fixed, because the diagnosis changed once the build got far enough to produce a different error:

    # this issue said what actually resolved it
    1 no "type": "module" still absent, and correctly so. vite moved to 6.4.3, which loads an ESM-only vitepress from a CJS-context config without it. The fault was version-specific to vite 5, not structural
    2 .vitepress/config.js is CommonJS moot once (1) is moot. The config has zero require() calls today anyway
    3 markdown-it-container cannot be required from the bundled config the dependency was dead (#299). The hook registering it was three kinds of redundant — VitePress ships those containers built in, no page uses ::: syntax, and the md handed to that hook is VitePress's own bundled instance, not the top-level package. Removed the hook and all three packages rather than making the require survive bundling. The only surviving mention is the comment explaining why they are gone
    4 three theme components do not exist fixed in #334. git log --all found no history for any of them — never written, not deleted. Two pages mounted them anyway and now say what they would have shown

    Two faults #317 did not know about, both found only once the import error stopped masking them, and both in #334: a ```python fence nested inside a ```markdown fence of equal length, so the inner fence closed the outer block and </CodeRunner> reached the Vue compiler as a stray tag; and a license link leaving the site root, which fails the build as a dead link.

    The gate is docs-site in ci.yml, running npx vitepress build .. As of #337 it installs with npm ci against a committed lockfile, so it tests a tree a reader can reproduce — which the original npm install did not.

    This issue's framing is the one that generalised: "a build target that nothing executes is free to rot indefinitely while looking fine." That is now three for three in this release — the JS SDK's 48 tsc errors (#314), the Java SDK's four compile errors, and this. Remaining instance: nothing runs docker build on docs-platform/Dockerfile, whose four missing COPY sources are #336.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ci-cdarea: docspriority: mediumtype: bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions