且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Angular 2+:IE 11无法获取未定义或空引用的属性“调用”

更新时间:2021-07-06 23:18:45

此错误仅在运行 ng服务时发生,并且不会在生产版本中发生,因此问题非关键,并且有一个解决方法,如下所示:

This error only happens when running ng serve, and will not occur in a production build, so the issue is non-critical, and has a workaround, as follows:

解决方法:发生这种情况时,请关闭浏览器,重新启动Angular-CLI dev服务器,然后重新打开浏览器到您的应用程序。(您无需清除缓存或其他任何东西。)

Workaround: When this occurs, close your browser, restart Angular-CLI dev server, and reopen the browser to your app. (You don't need to clear cache, or anything else.)

这可能与我的测试环境有关,而不是其他任何事情。我们一直在使用SauceLabs来测试IE。我们最近也开始使用VirtualBox。 更新:有时也会在VirtualBox中发生这种情况,但奇怪的是,在一次构建时,它有时会发生在一个测试环境中,而不是另一个。

This may have more to do with my testing environment than anything else. We've been using SauceLabs for testing IE. We recently started using VirtualBox as well. Update: This happens in VirtualBox sometimes as well, but it's odd that on one build, it sometimes occurs in one testing environment, and not the other.

此主题,github。 com / jakehockey10说:

Per this thread, github.com/jakehockey10 says:


我只有在使用
进行实时重载后才遇到此问题开发者工具打开。 Chrome和Firefox没有问题,但是如果我在IE11中打开开发人员工具
并且保存对我的打字稿的更改,几乎100%的时间都是
,我会在重新加载时收到这些错误。

I'm having this issue only after a live-reload occurs with the Developer Tools open. No issue with Chrome and Firefox, but if I have the Developer Tools open in IE11 and save a change to my typescript, nearly 100% of the time, I get these errors upon reload.

此外,Angular 6现已完全发布,并使用新的主要版本的Webpack。我还没有尝试过,但如果有人尝试通过升级来解决问题,我会很高兴。

Also, Angular 6 is now in full release, and uses a new major version of Webpack. I haven't tried it yet, but would be good to know if someone has tried resolving the issue by upgrading.