首页 > 解决方案 > 我应该关心“Zone.js 不支持 ES2017 中的本机异步/等待。”吗?

问题描述

从 Angular 9 升级到 10 后,我在运行 ng serve 时收到以下警告:

WARNING: Zone.js does not support native async/await in ES2017.
These blocks are not intercepted by zone.js and will not triggering change detection.
See: https://github.com/angular/zone.js/pull/1140 for more information.

(node:56581) ExperimentalWarning: The fs.promises API is experimental

有人知道这意味着什么,如果这是我应该关心的事情吗?

标签: angularzonejs

解决方案


我同意安德烈。它可能不会更新您的组件,尤其是当您从某个 API 获取数据时。要解决此问题,您可以将tsconfig.base.json文件中的目标更改回es2015.


推荐阅读