Bug: DevTools single-string console formatter consumes missing substitution arguments
維護者通常 1 天內回覆
@Hashim1999164 已經在處理了。
開始於 2026年7月26日。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 76/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 冷清
- 技術堆疊
- javascript, react
- 領域
- devtools
研究方向
從 packages/react-devtools-shared/src/backend/utils/index.js 的第185-233行附近開始,檢查 formatConsoleArgumentsToSingleString,並搭配 #36930 中同級函式 formatConsoleArguments 的行為進行查看。驗證缺少替換引數的範例,並在未匹配的指定符如預期輸出中一樣保持為字面值時,視為工作完成。
由索引模型根據 Issue 內容生成。
描述
React version: Current main (b685b40d)
Steps To Reproduce
- Call the DevTools helper with more substitution specifiers than arguments:
formatConsoleArgumentsToSingleString('%s %s', 'value');
formatConsoleArgumentsToSingleString('%d %d', 1);
- Observe the returned strings.
Link to code example:
The current behavior
The helper shifts from an empty arguments array for the unmatched specifier, so it returns value undefined and 1 NaN.
This helper is used to build the message key for warnings and errors logged during render, commit, and passive effects. As a result, DevTools can track a different message from the one produced by the console.
The expected behavior
Unmatched specifiers should remain literal, matching browser console behavior and Node util.format:
value %s
1 %d
The sibling formatConsoleArguments helper was updated with this behavior in #36930, but formatConsoleArgumentsToSingleString still consumes a missing argument.
- 主要語言
- JavaScript
- 星號
- 251k
- 分支
- 51.5k
- 平均合併
- 2 天 7 小時
- 30 天內合併 PR
- 30
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
react/react 的其他 Issue
-
Bug: ViewTransition reports Chromium's "Transition was aborted because of invalid state. Document hidden" as an uncaught error可能已有人在做 @Irish-Joseph 於 9 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
Bug: clearContainerSparingly throws "reading 'toLowerCase'" when a <link>'s rel is not a string可能已有人在做 @abin222 於 13 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
Bug: hidden-document InvalidStateError from ViewTransition is reported again on Chrome 153+ (message now carries a reason suffix)可能已有人在做 @lazerg 於 24 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
react/react#37669 · 1 個 reaction ·
維護者通常 1 天內回覆
-
Bug: DevTools facade returns non-serializable BigInt props and hook values可能已有人在做 @Liuzikaii 於 35 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
Compiler Result implementations reject valid variant-changing chains可能已有人在做 @OskarEichler 於 47 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
相似的 Issue
-
app_installations reports an error on every repo or suborg change when the plugin is not configured未關閉
難度 2/5 1-3 小時 新手友好度 64/100
github-community-projects/safe-settings#1111 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
needs triage
難度 2/5 1-3 小時 新手友好度 82/100
pbakaus/impeccable#1055 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 82/100
guaguastandup/zotero-pdf2zh#368 ·
-
Add: EUROTV NEWS未關閉channels:add check:passed
難度 2/5 1-3 小時 新手友好度 70/100