You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ tsc
../../node_modules/preact/src/jsx.d.ts(1078,3): error TS2304: Cannot find name 'PictureInPictureEvent'.
../../node_modules/preact/src/jsx.d.ts(1124,3): error TS2344: Type 'TargetedPictureInPictureEvent<Target>' does not satisfy the constraint 'TargetedEvent<EventTarget, Event>'.
Type 'TargetedPictureInPictureEvent<Target>' is missing the following properties from type 'Omit<Event, "currentTarget">': type, target, timeStamp, bubbles, and 17 more.
Steps to Reproduce
Steps to reproduce the behavior:
Create a preact project with typescript@v5.1.6
Try to build the project
See error
What is the expected behaviour?
A succeeding build
Please mention any other relevant information
This started after upgrading typescript from 5.1.3 to 5.1.6.
Please paste the results of npx preact-cli info here.
I cannot reproduce, can you walk me through the exact steps / commands used please?
The reason for this is that preact itself now uses type definitions that are only bundled in newer releases of TypeScript. You're not seeing this error because of using a newer version of TypeScript, but quite the opposite in fact; it seems that you're running an older version without those newer type defs (likely caused by your package manager, not you, to be clear).
What you can try to do is use "overrides"/"resolutions" in your package.json to specify the version of TypeScript that preact-cli should install (to 5.1.6, or whatever you want). Something like this:
This would force preact-cli to install a newer version of TypeScript to use, as (at the moment) it brings its own version along that it prioritizes.
We might be able to make TypeScript an optional peer dep, allowing users to bring in their own versions to avoid this completely, but I'll need a bit of time to test that out.
What is the current behaviour?
Steps to Reproduce
Steps to reproduce the behavior:
What is the expected behaviour?
A succeeding build
Please mention any other relevant information
This started after upgrading
typescript
from5.1.3
to5.1.6
.Please paste the results of
npx preact-cli info
here.The text was updated successfully, but these errors were encountered: