小编Kat*_*ran的帖子

在 Angular 8 中使用 cli 命令添加 Web Worker 后出现错误

Angular 8 为网络工作者添加了更好的支持。我没有运气让它工作。有人知道我做错了什么吗?

这是我遵循的官方指南

使用此 cli 命令,我生成了 Web Worker:

ng generate webWorker my-worker
Run Code Online (Sandbox Code Playgroud)

cli 生成了 my-worker.worker.ts 文件和 tsconfig.worker.json 文件,并更新了以下文件:angular.json、tsconfig.app.json。

在此之后,我收到以下错误:

ERROR in node_modules/typescript/lib/lib.dom.d.ts(25,1): error TS6200: Definitions of the following identifiers conflict with those in another file: EventListenerOrEventListenerObject, BlobPart, HeadersInit, BodyInit, RequestInfo, DOMHighResTimeStamp, CanvasImageSource, MessageEventSource, ImageBitmapSource, TimerHandler, PerformanceEntryList, VibratePattern, AlgorithmIdentifier, HashAlgorithmIdentifier, BigInteger, NamedCurve, GLenum, GLboolean, GLbitfield, GLint, GLsizei, GLintptr, GLsizeiptr, GLuint, GLfloat, GLclampf, TexImageSource, Float32List, Int32List, BufferSource, DOMTimeStamp, FormDataEntryValue, IDBValidKey, Transferable, BinaryType, ClientTypes, EndingType, IDBCursorDirection, IDBRequestReadyState, IDBTransactionMode, KeyFormat, …
Run Code Online (Sandbox Code Playgroud)

javascript web-worker angular angular8

3
推荐指数
1
解决办法
2941
查看次数

标签 统计

angular ×1

angular8 ×1

javascript ×1

web-worker ×1