Repository navigation
Conversation
|
@gitsacha is attempting to deploy a commit to the Lex Team on Vercel. A member of the Team first needs to authorize it. |
The rfm package's published dist/index.js does a runtime `import 'yaml'`, but `yaml` was only declared in the private @roughdraft/rfm workspace package. It was never promoted to the root package.json, so `npm i -g roughdraft` never installs it and every command crashes with ERR_MODULE_NOT_FOUND for 'yaml'. Promote `yaml` to the root dependencies so npm installs it into the package's node_modules, where Node resolves it by walking up from packages/rfm/dist. This matches the documented workaround in Lex-Inc#109. Fixes Lex-Inc#109
Regression test for Lex-Inc#109. @roughdraft/rfm ships as raw dist whose runtime imports are resolved from the installed package, so any runtime dep rfm declares must also live in the root package.json or a global install crashes with ERR_MODULE_NOT_FOUND. Fails on the missing 'yaml' before the dependency promotion, passes after.
gitsacha
force-pushed
the
fix/missing-yaml-runtime-dep
branch
from
August 12, 2026 20:23
f6f633d to
ef1a119
Compare
Author
|
Rebased onto current |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #109 — after a fresh
npm i -g roughdraft, every command crashes with:Root cause
@roughdraft/rfm's publisheddist/index.jsdoes a runtimeimport 'yaml'in Node.yamlis declared as a dependency of the private@roughdraft/rfmworkspace package, but the rootpackage.json(what users install) only lists@roughdraft/rfm(viafile:packages/rfm) andexpress. The rootfileswhitelist shipspackages/rfm/distas raw, unbundled code, so its runtime imports are resolved from the installed package'snode_modules— butyamlis never there, because it isn't declared in the manifest npm installs. The CLI is unusable.(
packages/appalso importsyaml, but that's bundled into its browser build, so it's unaffected — this only bites the Node-resolvedrfmruntime import.)Fix
Promote
yamlto the rootdependencies(matchingrfm's^2.9.0range). npm then installsyamlinto the package'snode_modules, where Node resolves it by walking up frompackages/rfm/dist. This makes the documented #109 workaround permanent. Lockfile updated to addyamlto the root importer (theyaml@2.9.0snapshot was already present transitively).Following the repo Bug Fix Workflow ("Prove It")
packages/server/src/packaging.test.tsasserts every runtime dependency of@roughdraft/rfmis declared in the rootpackage.json. It fails on the missingyamlbefore the promotion and passes after — a behavioral guard for the whole class of "transitive workspace runtime dep not promoted to the published manifest", not justyaml.yamlto the root manifest.Verification
Ran the full CI gate locally with pnpm 10 (matching
ci.yml'spnpm/action-setup@v4 version: 10):pnpm install --frozen-lockfile— accepts the lockfile edit; installsyaml 2.9.0at the root.pnpm check— exit 0 (biome lint +test:selectors+ vitest across all 5 workspace projects + build).packaging.test.tspasses; confirmed it fails without the dependency promotion.