Fix the startup crash on a clean install; cut 1.2.1 - #38
Merged
Conversation
Every published version of @formo/cli currently crashes on startup for
anyone who installs it:
$ npm i @formo/cli && formo --version
incur/dist/Mcp.js:1
import { McpServer, StdioServerTransport } from '@modelcontextprotocol/server';
SyntaxError: The requested module '@modelcontextprotocol/server'
does not provide an export named 'StdioServerTransport'
incur@0.3.25 asked for `^2.0.0-alpha.2` of @modelcontextprotocol/server.
Our lockfile pinned 2.0.0-alpha.2, which exports StdioServerTransport, but
2.0.0 stable has since shipped without it and satisfies that range. Lock-
files do not reach consumers, so every install after 2.0.0 was published
resolved to the broken version. Reproduced with both npm and pnpm on 1.1.1
and 1.2.0.
incur@0.4.26 fixes it upstream by pinning the dependency exactly
(2.0.0-alpha.4), so bump to it rather than working around the range here.
The kebab-case patch is still required — 0.4.26 renders option definitions
kebab-case but examples, usage lines, CTAs and skill tables still emit the
raw camelCase key — so it is re-cut against the new version and the four
relocated sites.
Add a `smoke` CI job that packs the tarball and installs it with npm, the
way a user does. Every existing job installs from the lockfile, which
replays pinned transitive versions and therefore structurally cannot catch
a consumer-facing resolution break.
Also make a supplied-but-rejected TEST_TOKEN fail the suite instead of
skipping it. Skipping made an expired credential indistinguishable from a
healthy run, which is how CI stayed green across the entire canonical-
filter migration without once calling the API. An absent token still skips,
so fork PRs are unaffected.
Verified: packed 1.2.1 installs under npm, resolves @modelcontextprotocol/
server@2.0.0-alpha.4, and runs `analytics kpis` and `profiles search`
against api.formo.so.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
The bug
Every published version of
@formo/clicrashes on startup for anyone who installs it. Reproduced with npm and pnpm, on 1.1.1 and 1.2.0:npx @formo/cliis affected too. This is not a 1.2.0 regression — it went live the moment the upstream2.0.0was published.Root cause
incur@0.3.25declares"@modelcontextprotocol/server": "^2.0.0-alpha.2". Ourpnpm-lock.yamlpins2.0.0-alpha.2, which still exportsStdioServerTransport. The2.0.0stable release dropped that export and satisfies the caret range. Lockfiles don't ship to consumers, so every fresh install resolves to the broken version.Locally everything looked fine: pnpm replays the lockfile, and
minimumReleaseAge: 2880inpnpm-workspace.yamlholds new releases back two days.The fix
Bump
incur0.3.25 → 0.4.26. Upstream fixed this properly by pinning the dependency to an exact2.0.0-alpha.4, so consumers cannot drift. That's better than pinning a direct dependency here to work around the range.Re-cut the kebab-case patch. Still needed on 0.4.26 — option definitions now render kebab-case upstream, but examples, usage lines, CTAs and skill tables still emit the raw camelCase key. The four sites moved (
formatCtais nowinternal/cta.js), so the patch is regenerated against the new version andpatches/incur.patchis replaced bypatches/incur@0.4.26.patch.Preventing a recurrence
New
smokeCI job: packs the tarball, installs it with npm in a temp dir, and asserts the binary starts and renders help. Every existing job runspnpm install --frozen-lockfile, which replays pinned transitive versions and so structurally cannot catch a consumer-facing resolution break. Nothing in the pipeline installed the package the way a user does.A rejected
TEST_TOKENnow fails the suite instead of skipping. Skipping made an expired credential indistinguishable from a healthy run — which is how CI reported green across the entire canonical-filter migration (#29–#33) without ever calling the API. An absent token still skips, so fork PRs stay green.Verification
Packed
1.2.1, installed it with npm in a clean directory:@modelcontextprotocol/server@2.0.0-alpha.4formo --version→1.2.1formo analytics kpis --date-from 2026-07-01 --date-to 2026-07-31returns live dataformo profiles search --filters '[{"field":"users.net_worth_usd","op":"gt","value":1000}]'returns a live profilepnpm lint,pnpm typecheckandpnpm buildall pass.Known issue, not fixed here
The kebab-case patch is dev-only — it never reaches consumers, so the published CLI's
--helpexamples still print--dateFromrather than--date-from. Pre-existing and cosmetic, but it means the patch doesn't help the people it was written for. Worth an upstream fix in incur.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.