CLI crashes on startup with @opentelemetry/semantic-conventions default export error
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 65/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
- Lĩnh vực
- cli
Hướng nghiên cứu
Đọc mục phụ thuộc @opentelemetry/semantic-conventions trong package.json và xác định import trong dist/cli.mjs được mô tả trong báo cáo. Kiểm tra exports của phiên bản 1.44.0 khác phiên bản 1.43.0 như thế nào, sau đó tái hiện lỗi bằng một lần cài đặt sạch và chạy cmdc --version, --help và info. Hoàn tất khi các lần cài đặt mới khởi chạy mà không gặp SyntaxError do thiếu default export.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Root Cause
-
Upstream Breaking Change:
• On October 28, 2026, @opentelemetry/[email protected] was published. In this release, the package build was revamped with tsdown,
routing ESM imports directly to ./dist/index.mjs, which exposes only named exports and no default export.
• In previous versions (1.43.0 and earlier), exports fell back to CommonJS (build/src/index.js), which allowed Node.js to synthesize a default
export object. -
Permissive Semver Range:
• command-code (the package behind cmdc) specified "@opentelemetry/semantic-conventions": "^1.30.0" in its dependencies.
• When installed, npm resolved the dependency to the newly released 1.44.0.
• The bundled code in cli.mjs performs:
import ze from "@opentelemetry/semantic-conventions";• Because 1.44.0 has no default export, Node.js halted execution with a SyntaxError.
──────
Resolution Applied
- Downgraded Dependency:
• Replaced @opentelemetry/semantic-conventions in command-code's global node_modules with version 1.43.0. - Pinned Version:
• Pinned the dependency to exact version "1.43.0" in package.json to prevent automatic re-upgrades until command-code publishes an official
patch. - Verification:
• Verified that cmdc --version (outputs 1.88.1), cmdc --help, and cmdc info execute and exit cleanly without errors.
────────────────────────────────────────────────────────────
need to file bug on github issues with the exact packge version give me content for this
▸ Thought for 6s
Here is a complete, preformatted issue report ready to paste into GitHub Issues:
──────
Title
[Bug]: SyntaxError: The requested module '@opentelemetry/semantic-conventions' does not provide an export named 'default' on startup
──────
Issue Body
### Describe the Bug
When running `cmdc` (or `cmd`, `command-code`), the CLI crashes immediately on startup with a `SyntaxError`:
SyntaxError: The requested module '@opentelemetry/semantic-conventions' does not provide an export named 'default'
at #_instantiate (node:internal/modules/esm/module_job:254:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:369:5)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:691:26)
at async file:///.../command-code/dist/index.mjs:2:1757
### Environment
- **Package Version**: `[email protected]`
- **Node Version**: `v24.11.0` (affects Node >= 22)
- **OS**: Windows (win32 x64) / macOS / Linux
- **npm Version**: Current (`npm i -g command-code`)
### Steps to Reproduce
1. Install `command-code` globally:
```bash
npm install -g command-code
-
Run any command:
cmdc --version
# or
cmd -
Observe the crash before the CLI loads.
Root Cause Analysis
-
In [email protected]'s package.json, @opentelemetry/semantic-conventions is specified as:
"@opentelemetry/semantic-conventions": "^1.30.0" -
On October 28, 2026, @opentelemetry/[email protected] was released. This release revamped the build output with tsdown and routed
exports directly to pure ESM (./dist/index.mjs), which provides only named exports and no default export. -
In earlier versions (1.43.0 and below), the package entrypoint pointed to CommonJS (build/src/index.js), enabling Node's synthetic default
import. -
Because ^1.30.0 resolves to 1.44.0 on fresh installs, dist/cli.mjs fails when executing:
import ze from "@opentelemetry/semantic-conventions";
// ...
({ ATTR_SERVICE_NAME: ZD, ATTR_SERVICE_VERSION: eN } = ze)
Proposed Solutions
Any of the following will fix the issue:
-
Named Import (Recommended): Change the import in the source to named imports:
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions";
or namespace import:
import * as ze from "@opentelemetry/semantic-conventions"; -
Pin Dependency Version: Pin the dependency in package.json until the import style is updated:
"@opentelemetry/semantic-conventions": "1.43.0"
Expected Behavior
Expected Behavior
The CLI (`cmdc`, `cmd`, or `command-code`) should start up successfully and display the interactive interface or handle flags (e.g.,
`--version`, `--help`) without throwing a module resolution `SyntaxError`.
Actual Behavior
### Actual Behavior
The CLI immediately crashes upon execution and exits with code 1 before loading any commands or interface:
```text
SyntaxError: The requested module '@opentelemetry/semantic-conventions' does not provide an export named 'default'
at #_instantiate (node:internal/modules/esm/module_job:254:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:369:5)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:691:26)
at async file:///.../command-code/dist/index.mjs:2:1757
Node.js v24.11.0
Steps to reproduce the issue
Steps to Reproduce
1. Install `command-code` globally via npm (or clean install):
```bash
npm install -g command-code
- Run any command or flag using cmdc, cmd, or command-code:
cmdc --version
(or simply cmdc) - The process crashes immediately with the SyntaxError.
Command Code Version
1.88.1
Operating System
Windows
Terminal/IDE
No response
Shell
No response
Session file (optional)
No response
Fix prompt (optional)
### Context
`@opentelemetry/[email protected]` switched its ESM build (`dist/index.mjs`) to export only named attributes, dropping the synthetic
CommonJS default export. Because `package.json` specifies `"^1.30.0"`, fresh installs pull in `1.44.0`, breaking `import ze from
"@opentelemetry/semantic-conventions"` with:
`SyntaxError: The requested module '@opentelemetry/semantic-conventions' does not provide an export named 'default'`
### Instructions
1. In the source file where `@opentelemetry/semantic-conventions` is imported:
- Replace any default import (`import ze from "@opentelemetry/semantic-conventions"`) with named imports:
```typescript
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions";
```
- Or change to a namespace import:
```typescript
import * as ze from "@opentelemetry/semantic-conventions";
```
2. (Optional safeguard) Pin the dependency in `package.json`:
```json
"@opentelemetry/semantic-conventions": "~1.43.0"
```
3. Rebuild the CLI and ensure `cmdc --version` executes cleanly without throwing `SyntaxError`.
`````*
Additional context
No response
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 4.2k
- Fork
- 372
- Merge trung bình
- 4 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommandCodeAI/command-code
-
Provider /v1/messages rejects role:"system" inside messages[] — Claude Code ≥ 2.1.154 incompatibleĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
CommandCodeAI/command-code#1085 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CommandCodeAI/command-code#1082 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Feature request: auto-reconnect remote control (/rc) after restartCó thể đã có người làm @aliarain đã nhận 7 ngày trước. Đang mởp2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
CommandCodeAI/command-code#992 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#933 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#855 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của CommandCodeAI/command-code
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
FireDynamics/LEDSmokeAnalysis#176 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
add accepts Infinity scores and writes records that immediately fail validationCó thể đã có người làm @vivek-3728 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
techcsispit/grade-tracker#69 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Validar --lang en el parserĐang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
datamodel-code-generator/datamodel-code-generator#5589 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-core bug P-medium S-ready-to-start
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Ryubara/coney#1165 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày