Fresh install of 1.88.1 fails on startup: '@opentelemetry/semantic-conventions' has no default export
Maintainer thường phản hồi trong vòng 1 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
- 76/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
Hướng nghiên cứu
Bắt đầu bằng cách đọc package.json và import trong dist/cli.mjs cho @opentelemetry/semantic-conventions; issue chỉ ra default import bị lỗi và khoảng phiên bản dependency được phân giải thành 1.44.0. Kiểm tra cách package cung cấp các ESM export, sau đó đóng gói và cài đặt nó vào một prefix sạch rồi chạy cmd --version; hoàn tất khi một bản cài đặt mới khởi động và in ra phiên bản.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- npm i -g command-code@latest
- cmd --version
- 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.****
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 4.2k
- Fork
- 377
- Merge trung bình
- 3 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 8
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
CommandCodeAI/command-code#1088 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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 1 ngày
-
Feature request: auto-reconnect remote control (/rc) after restartCó thể đã có người làm @aliarain đã nhận 10 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 1 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 1 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 1 ngày
Tất cả issue của CommandCodeAI/command-code
Issue tương tự
-
v3: Lua m.setvar() returns -1 on errors, so the script gets stack garbageCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở3.x bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
owasp-modsecurity/ModSecurity#3731 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Prerender check returns HTTP 500 when the request URI or Referer header is longer than PHP_MAXPATHLENCó thể đã có người làm @lbajsarowicz đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
area: quality enhancement priority: should
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
openmainframeproject/feilong#980 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100