vue3打包 error in node_modules/@types/node/stream/web.d.ts 错误解决办法

ue3项目打包的时候突然报错,错误如下

ERROR Failed to compile with 1 error 14:13:57 error in node_modules/@types/node/stream/web.d.ts:469:56 TS1005: '?' expected. 467 | // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts 468 | ReportingObserver: any; > 469 | DecompressionStream: infer T extends object; | ^ 470 | } ? T 471 | // TS 4.8, 4.9, 5.0 472 | : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? { ERROR Error: Build failed with errors. Error: Build failed with errors. at D:\opt\projects\compan

这里说@types/node这个插件报错,点进去发现这行代码

DecompressionStream: infer T extends object;

这里是一个typescript的类型继承定义,直接改这样

DecompressionStream: infer T extends object ? T : never;

就可以打包成功了

你可能感兴趣的:(前端,javascript,开发语言)