Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]新版本chrome浏览器下,angular子应用接入qiankun,断点调试控制台this指向window,没有指向组件实例 #2920

Open
Gcgetget opened this issue Mar 5, 2024 · 4 comments

Comments

@Gcgetget
Copy link

Gcgetget commented Mar 5, 2024

What happens?

新版本chrome浏览器下,angular子应用接入qiankun框架,断点调试,控制台source里hover到this上,提示显示的是window实例,而不是组件实例,但是右侧this显示的是组件实例,如下图所示:
image
控制台输出this,也是打印的window,如下:
image
但是,如果是在setTimeout里的this,指向是组件实例是正常的,如下:
image

上面情况非常影响调试,不知道怎么解决。但是低版本的chrome浏览器没有这个问题,比如90.0.4430.72版本

相关环境信息

  • qiankun 版本:2.10.1
  • 浏览器版本:122.0.6261.95(正式版本)
  • 操作系统:Windows 10 x64
@bravepg
Copy link
Contributor

bravepg commented Mar 6, 2024

有可以复现的地址吗?

@Gcgetget
Copy link
Author

Gcgetget commented Mar 6, 2024

有可以复现的地址吗?
没有,公司内部项目

@chjtx
Copy link

chjtx commented Mar 9, 2024

应该大概可能是webpack的问题,我以前用webpack3.x的时候在浏览器控制台调试也是这样的

@Gcgetget
Copy link
Author

Gcgetget commented Mar 9, 2024

应该大概可能是webpack的问题,我以前用webpack3.x的时候在浏览器控制台调试也是这样的

webpack是5.88.2版本。在代码中console.log(this),输出this是组件实例正确的,但是控制台调试hover到this上就显示widow,控制台输出this也是window。
但是下面这种情况又是好的,不知道咋解决
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants