Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Fresh install of 1.88.1 fails on startup: '@opentelemetry/semantic-conventions' has no default export

Aberta Para iniciantes
#1,082 1 comentário 2 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
76/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
javascript, node.js
Domínio
backend, cli

Direção de pesquisa

Comece lendo package.json e o import em dist/cli.mjs para @opentelemetry/semantic-conventions; a issue identifica o import padrão que falha e o intervalo de dependência que é resolvido para 1.44.0. Confira como o pacote expõe suas exportações ESM, depois empacote-o, instale-o em um prefixo limpo e execute cmd --version; está concluído quando uma instalação nova inicia e imprime a versão.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Summary

After a fresh global npm install of command-code@latest (1.88.1), cmd cannot start. Even cmd --version exits immediately with a module-loading SyntaxError, so the CLI is unusable until the dependency is manually downgraded.

Expected Behavior

A fresh npm i -g command-code@latest should produce a working CLI. cmd --version should print 1.88.1, and cmd should start normally without any manual patching.

Actual Behavior

Every invocation of cmd (including cmd --version) crashes before startup:
SyntaxError: The requested module '@opentelemetry/semantic-conventions' does not provide an export named 'default'
at #asyncInstantiate (node:internal/modules/esm/module_job:463:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:561:5)
at async node:internal/modules/esm/loader:650:26
at async file:///.../.local/lib/node_modules/command-code/dist/index.mjs:2:1757

Steps to reproduce the issue
  1. npm i -g command-code@latest
  2. cmd --version
  3. The CLI exits immediately with the SyntaxError above.
Command Code Version

1.88.1

Operating System

macOS

Terminal/IDE

Apple Terminal

Shell

zsh

Session file (optional)

N/A — the CLI crashes before a session can be created.

Fix prompt (optional)

In dist/cli.mjs, @opentelemetry/semantic-conventions is imported with a default import:

import ze from "@opentelemetry/semantic-conventions";
...
({ATTR_SERVICE_NAME: ZD, ATTR_SERVICE_VERSION: eN} = ze)

The dependency range in package.json is ^1.30.0, which now resolves to 1.44.0.
That version exposes its ESM entry (dist/index.mjs) via the default export
condition, and the ESM entry has no default export, so module loading fails.

Fix by importing the two named exports directly:

import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions";

Alternatively, pin @opentelemetry/semantic-conventions to 1.43.0, which resolves
to the CJS build in ESM contexts and still provides a default export.

Verify by packing the package, installing it into a clean prefix with a fresh
npm install, and running cmd --version.

Additional context
  • Node.js: v26.8.1
  • npm: 11.19.0
  • Fresh install resolves @opentelemetry/[email protected] due to the ^1.30.0 range.
  • 1.44.0 exports require -> dist/index.cjs but default -> dist/index.mjs; the ESM entry only has named exports. Earlier versions such as 1.43.0 resolve to the CJS build in ESM contexts, so the default import works.
  • Replacing the installed @opentelemetry/semantic-conventions with 1.43.0 makes cmd --version work again.
  • The other OpenTelemetry imports (resources, sdk-trace-node, exporter-trace-otlp-http) still provide a CJS default and are not affected.****
Linguagem predominante
Sem dados de linguagem
Estrelas
4.2k
Forks
372
Merge médio
4d 15h
PRs com merge (30d)
9

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de CommandCodeAI/command-code

Todas as issues de CommandCodeAI/command-code

Issues semelhantes

Mais issues de Backend & API Design

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.