添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

TS2552: Cannot find name 'PictureInPictureEvent'. Did you mean 'PictureInPictureEventHandler'?

Ask Question

I have upgraded my Angular app to version 15 from 14. After upgrade I am getting following errors 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>'.

Following are the config details

"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

What am I doing wrong here?

You need to use TS 4.9+ w/ Preact v10.15.0. You can upgrade your TS version or downgrade Preact.

You can follow this link, for reference link

This issue is due to a version mismatch of TS and Preact.

After trying to update TS for different versions to check compatibility with Preact I was still not able to solve this.

What solved this issue for me was adding the following statement within "compilerOptions" in tsconfig.json file.

"skipLibCheck": true
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.