Fresh install of 1.88.1 fails on startup: '@opentelemetry/semantic-conventions' has no default export
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 76/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript, node.js
研究方向
先閱讀 package.json,以及 dist/cli.mjs 中對 @opentelemetry/semantic-conventions 的匯入;issue 指出失敗的預設匯入,以及會解析至 1.44.0 的相依性範圍。檢查此套件如何匯出 ESM,接著將它打包並安裝至乾淨的 prefix,再執行 cmd --version;新安裝能啟動並印出版本號即表示完成。
由索引模型根據 Issue 內容生成。
描述
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.****
- 主要語言
- 沒有語言資料
- 星號
- 4.2k
- 分支
- 372
- 平均合併
- 4 天 15 小時
- 30 天內合併 PR
- 9
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CommandCodeAI/command-code 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
CommandCodeAI/command-code#1088 ·
維護者通常 2 天內回覆
-
Provider /v1/messages rejects role:"system" inside messages[] — Claude Code ≥ 2.1.154 incompatible未關閉
難度 2/5 1-3 小時 新手友好度 75/100
CommandCodeAI/command-code#1085 ·
維護者通常 2 天內回覆
-
Feature request: auto-reconnect remote control (/rc) after restart可能已有人在做 @aliarain 於 8 天前認領。 未關閉p2
難度 2/5 1-3 小時 新手友好度 85/100
CommandCodeAI/command-code#992 · 1 則留言 · 已指派 1 人 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#933 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#855 ·
維護者通常 2 天內回覆
查看 CommandCodeAI/command-code 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 90/100
pollen-robotics/reachy_mini#1527 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆
-
inflate: total_in uses plain += on c_ulong (32-bit on Windows), panics in debug for streams > 4 GiB未關閉
難度 1/5 1 小時以內 新手友好度 85/100
trifectatechfoundation/zlib-rs#570 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
gbourgeat/ddd-ts-kit#680 ·
維護者通常 1 天內回覆