Skip to content

T-S0TW-markdown-contract-browser-import

Status: closed/done · Impact: medium · Complexity: small

product-media and product-search fail nuxt generate: their client bundles reach the vendored markdown-contract package, whose dist/runner/corpus.js imports node:path (sep), and Vite’s browser external stub rejects it. This blocks the full proto:build sweep (the e2e prep step) and any CI lane that builds every product.

LocationRole today
vendor/markdown-contract-0.2.1.tgzThe vendored release. Its dist/runner/ (the conformance-test half) imports node:path and is not split from the browser-safe contract core
solutions/determined/packages/vault-contracts/package.jsonDepends on the tgz via file:; every shape module does import { contract } from 'markdown-contract'
solutions/determined/experiences/mediaExtends into product-media; a client-side vault-contracts import drags the whole tgz into the bundle
solutions/determined/products/medianuxt generate fails on the node:path import
solutions/determined/products/searchSame failure, same chain

Both products build. markdown-contract’s browser-reachable surface has no Node imports: the runner half lives behind its own subpath export that browser bundles never resolve, or the two experiences stop importing vault-contracts from client code.

  1. Trace the client-side import: which media/search module pulls vault-contracts into the browser bundle, and does it need the contract objects there at all? If not, move the import server-side and stop.
  2. Otherwise split upstream: markdown-contract (its own repo) exports the contract core at . with no Node imports and the runner at ./runner; cut a new release, re-vendor the tgz, bump vault-contracts.
  3. Re-run bun run proto:build in solutions/determined; all products green.
LocationKindChange
vendor/markdown-contract-0.2.1.tgzdeleteReplaced by a split-exports release (if step 2 is needed)
solutions/determined/packages/vault-contracts/package.jsonmodifyBump the vendored dep
  • AC-1: bun run proto:build in solutions/determined exits 0 — product-media and product-search included.
  • AC-2: No node: specifier resolves into either product’s client bundle from markdown-contract.
  • augmented_web’s separate build breakage (T-WORD).
  • none
  • Surfaced by the json-canvas promotion’s full product sweep (PR #1308 verification); pre-existing on main, fallout of the M-6TQL markdown-util extraction era.

← Back to Tasks