typescript TS2552:找不到名称“PictureInPictureEvent”,您是指“PictureInPictureEventHandler”吗?

z31licg0  于 2023-06-24  发布在  TypeScript
关注(0)|答案(1)|浏览(170)

我已经将我的Angular应用程序从14升级到了15版。升级后,我收到以下错误Error: node_modules/preact/src/jsx.d.ts:1078:3 - error TS2552: Cannot find name 'PictureInPictureEvent'. Did you mean 'PictureInPictureEventHandler'?
然后呢
node_modules/preact/src/jsx.d.ts:1124:3 - error TS2344: Type 'TargetedPictureInPictureEvent<Target>' does not satisfy the constraint 'TargetedEvent<EventTarget, Event>'.
下面是配置详细信息

{
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "target": "ES2022",
    "downlevelIteration": true,
    "declaration": false,
    "importHelpers": true,
    "lib": [
      "ES2022",
      "dom"
    ],
    "module": "esnext",
    "moduleResolution": "node",
    "sourceMap": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "suppressImplicitAnyIndexErrors": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "watch": false
  },
  "exclude": [
    "node_modules"
  ],
  "angularCompilerOptions": {
    "strictInjectionParameters": true
  }
}

我做错了什么?

hmtdttj4

hmtdttj41#

您需要使用TS 4.9+ w/ Preact v10.15.0。您可以升级您的TS版本或降级Preact。
您可以点击此链接,以供参考link

相关问题