Spot the bug in Mode parsing

from Literal types
TypeScript 6 intermediate 5 min 1 issue to find

Find why this generated parser does not establish a valid Mode.

TypeScript
type Mode = "safe" | "fast";

function parseMode(raw: string): Mode {
  const payload = JSON.parse(raw) as { mode: Mode };
  return payload.mode;
}
Open in playground
Report an error