Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[bug]: @sf-agentscript/lsp-server@2.2.30 crashes at startup — variantMatch is not a function (stale @sf-agentscript/language pin)

Abierto
#73 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
node.js, typescript
Área
devtools, tooling

Línea de trabajo

Empieza con las declaraciones de dependencias de @sf-agentscript/agentforce-dialect, @sf-agentscript/lsp y @sf-agentscript/lsp-server; después, revisa la prueba smoke de importación posterior a la publicación propuesta en #72. Reprodúcelo con npx --yes @sf-agentscript/lsp-server --stdio y verifica que una instalación nueva complete el handshake de inicialización de LSP y publique diagnósticos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Description

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/lsp@2.3.8).

Steps to Reproduce

  1. npx --yes @sf-agentscript/lsp-server --stdio
    (or npm install -g @sf-agentscript/lsp-server and run agentscript-lsp --stdio)
  2. 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/agentforce-dialect@2.13.4 (published 2026-06-10)
uses the variantMatch schema-builder API but pins
@sf-agentscript/language@2.5.4 (2026-06-01), which predates that API.
variantMatch first shipped in @sf-agentscript/language@2.8.4 (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)
  • Package & version: @sf-agentscript/lsp-server 2.2.30 (also @sf-agentscript/lsp 2.3.8)
  • Browser (if applicable): n/a

Minimal Reproduction

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):

{
  "dependencies": { "@sf-agentscript/lsp-server": "2.2.30" },
  "overrides": { "@sf-agentscript/language": "2.8.4" }
}

Additional Context

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.

Lenguaje dominante
TypeScript
Estrellas
267
Forks
54
Merge medio
48 min
PR fusionados (30 d)
1

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de salesforce/agentscript

Todos los issues de salesforce/agentscript

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.