nodejs / nodejs/node

Chrome devtools console method autocompletion for node is not working

未关闭
#56,637 10 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

inspector
主要语言
JavaScript
星标
122k
派生
37.3k
平均合并
4 天 2 小时
30 天内合并 PR
283

描述

Version

v22.13.0

Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem

No response

What steps will reproduce the bug?
  1. open Chrome 132.0.6834.84 and load chrome://inspect
  2. open dedicated devtools for node
  3. run "node --inspect"
  4. wait for node to connect to devtools
  5. enter "global." in the devtools console
  6. the autocompletion method list does not pop up
How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

The autocompletion method list is expected to pop up as it does for browser objects and as it used to for node:

Image

What do you see instead?

No autocomplete method popup.

Additional information

Since this is working in Chrome 113, it appeared as a Chrome issue and was submitted on the Chrome bug tracker, but was closed with the following response:

https://issues.chromium.org/u/2/issues/390205856#comment5

This is a Node.js issue. I can reproduce this down to Node 14, but with Node 12 autocompletion works as expected.

The way autocompletion of object properties works is that we evaluate the input, but abort if this evaluation may cause a side effect. Without side effect, we get the object properties and offer these properties as autocomplete options.

From Node 14, side effect check fails. You can easily check this by running Node with node --trace-side-effect-free-evaluate --inspect.

I would suggest you file an issue on the Node issue tracker.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 Node v22.13.0、node --inspect、Chrome 132,并在专用 DevTools 控制台中使用 global. 复现。将其与 node --trace-side-effect-free-evaluate --inspect 进行比较,并跟踪 inspector 自动补全的副作用评估路径;完成标准是 global. 再次显示方法补全。

由索引模型根据 Issue 内容生成。

评估

技术栈
devtools, javascript, nodejs
领域
developer-experience, devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。