Skip to content

Conversation

@Bahati308
Copy link
Contributor

@Bahati308 Bahati308 commented Dec 9, 2025

What changed

Replaced use of NodeJS.Timeout with ReturnType in AudioQuestionRenderer. This change makes the timer type compatible with browsers (where setInterval returns a numeric ID), fixing a TypeScript compilation error on macOS.

Why this happens:

  • In Node.js, setInterval returns a NodeJS.Timeout object.
  • In browsers, setInterval returns a number (the ID of the timer).
  • Your TypeScript type was NodeJS.Timeout | null, so TypeScript expects the Node object. In the browser, setInterval returns a number → type mismatch.

Why this is needed

The previous use of NodeJS.Timeout caused a type mismatch in browser environments — most end‑users of ODE (particularly formplayer) expect to run in browsers (not Node), so this prevented successful builds / bundling for browser targets.
Ensures cross‑platform compatibility (Node + browser), which aligns with ODE’s (particularly formplayer)design goal of being usable in mobile/offline‑first or web environments.

Related issue / context

Fixes #50

Bahati308 and others added 4 commits December 4, 2025 20:39
…nderer

Replace NodeJS.Timeout with ReturnType<typeof setInterval> to fix
TypeScript compilation error on macOS. This ensures cross-platform
compatibility between browser (number) and Node.js (Timeout) timer types.

Fixes OpenDataEnsemble#50
@Bahati308 Bahati308 marked this pull request as ready for review December 9, 2025 06:54
Copy link
Contributor

@r0ssing r0ssing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!!

@Bahati308 Bahati308 merged commit b950797 into OpenDataEnsemble:dev Dec 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript build fails on macOS due to incorrect timer type in AudioQuestionRenderer

2 participants