type errors on `addEventListener` for any class that extends from `EventDispatcher`
Open
Nobody has claimed this yet.
bug
- Dominant language
- JavaScript
- Stars
- 858
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
@types/threeversion: from 0.168.0three-stdlibversion: 2.34.0
Problem description:
@types/three introduced on v168 the breaking change that unknown events can no longer be dispatched in EventDispatcher (source).
Relevant code:
So now this will throw TS errors:
import { OrbitControls } from "three-stdlib";
const orbit = new OrbitControls();
orbit.addEventListener("start", ()=> console.log('started'));
// Argument of type 'string' is not assignable to parameter of type 'never'.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the listed OrbitControls addEventListener example with @types/three 0.168.0 and three-stdlib 2.34.0, then inspect the EventDispatcher typing used by OrbitControls. Done means the "start" listener type-checks without the string-to-never error while preserving event typing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- three.js, typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100