You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug]: @sf-agentscript/[email protected] crashes at startup — variantMatch is not a function (stale @sf-agentscript/language pin) #73
The published @sf-agentscript/lsp-server (2.2.30, currently latest) crashes
at startup with TypeError: ...variantMatch is not a function, before the LSP
connection is established. The root cause is a stale exact pin on the transitive @sf-agentscript/language dependency, so no fresh install of the LSP server
works (same for @sf-agentscript/[email protected]).
Steps to Reproduce
npx --yes @sf-agentscript/lsp-server --stdio
(or npm install -g @sf-agentscript/lsp-server and run agentscript-lsp --stdio)
The process throws immediately, before any LSP handshake.
Expected Behavior
The server starts, completes the LSP initialize handshake, and publishes
diagnostics.
Actual Behavior
Immediate crash at import:
.../@sf-agentscript/agentforce-dialect/dist/schema.js:217
.variantMatch('byon', (value) => value.startsWith(BYON_SCHEMA_PREFIX), byonSubagentVariant);
^
TypeError: NamedBlock(...).describe(...).discriminant(...).variant(...).variantMatch is not a function
Cause:@sf-agentscript/[email protected] (published 2026-06-10)
uses the variantMatch schema-builder API but pins @sf-agentscript/[email protected] (2026-06-01), which predates that API. variantMatch first shipped in @sf-agentscript/[email protected] (2026-06-11,
one day after the dialect) — the dialect appears to have been built against
the unreleased workspace version of language and published with a stale exact
pin. Because every @sf-agentscript/* dependency is an exact pin, no fresh
install can resolve a working language.
Fix: republish agentforce-dialect / lsp / lsp-server against @sf-agentscript/language >= 2.8.4 (current train is 2.19.3).
Environment
Node.js version: 22.18.0
pnpm version: n/a (reproduced with npm / npx)
OS: Windows 11 (also reproduced in the node:22-bookworm container)
The crash happens before any .agent source is read, so no snippet is required —
just running the server reproduces it:
npx --yes @sf-agentscript/lsp-server --stdio
Verified workaround — install with an npm overrides fix, after which the
server initializes and publishes diagnostics normally (verified against
Neovim's LSP client on Node 22):
This is the same publish-pipeline defect already reported for a sibling package
in #71 (@sf-agentscript/agentforce unusable for the same reason, different
missing symbol), and the earlier #35 / #40 scope-rewrite incident. The
post-publish import smoke test proposed in #72 would have caught this too.
changed the title [-]`@sf-agentscript/[email protected]` crashes at startup: `variantMatch is not a function` (stale `@sf-agentscript/language` pin)[/-][+][bug]: @sf-agentscript/[email protected] crashes at startup — variantMatch is not a function (stale @sf-agentscript/language pin)[/+]on Jul 22, 2026
Resolved in the current releases. A fresh install of @sf-agentscript/[email protected] resolves @sf-agentscript/[email protected] and @sf-agentscript/[email protected], with matching pins, and agentscript-lsp --stdio starts without the variantMatch error. Please reopen if you still see it.
Activity
[-]`@sf-agentscript/[email protected]` crashes at startup: `variantMatch is not a function` (stale `@sf-agentscript/language` pin)[/-][+][bug]: @sf-agentscript/[email protected] crashes at startup — variantMatch is not a function (stale @sf-agentscript/language pin)[/+]setu4993 commentedon Nov 14, 2026
Resolved in the current releases. A fresh install of
@sf-agentscript/[email protected]resolves@sf-agentscript/[email protected]and@sf-agentscript/[email protected], with matching pins, andagentscript-lsp --stdiostarts without thevariantMatcherror. Please reopen if you still see it.