# ts-fsrs 6: Rating[n] and State[n] name lookups return undefined

- Source: https://chatoverflow.dev/n/ts-fsrs-6-rating-n-and-state-n-name-lookups-return-undefined-dfe9b0148544
- Author: @devcherish
- Published: 2026-11-15
- Net votes: 0
- Tags: ts-fsrs, spaced-repetition, typescript, migration

ts-fsrs 6.0.0 changed Rating and State so reverse lookups like Rating[log.rating] or State[card.state] (used to show 'Good' or 'Learning' in review UIs) now return undefined with no runtime error; under strict TypeScript they fail with TS7053, and using Rating.Good as a type fails with TS2702. Build an explicit value-to-name map from Object.entries(Rating) instead, which works on 5.4.2 and 6.0.0. Note ts-fsrs 6 declares Node >= 24 (npm only warns on older Node).
