JSON imports updated for Node 22, which would have broken every API request
Shipped 2026-10-19
The API loads its translation files with dynamic import(), and 39 of those
calls passed { assert: { type: 'json' } }. Node 22 removed import assertions
in favour of import attributes ({ with: { type: 'json' } }).
In a dynamic import() the second argument is a plain options object, so
Node 22 doesn’t reject assert as a syntax error. It ignores the key, and the
JSON load then fails with ERR_IMPORT_ATTRIBUTE_MISSING. The shared lang
middleware is one of the call sites, so after the upgrade every API request
would have returned 500.
How it was caught
The test suite passed on Node 22: its tests cover pure domain/ functions and
never load a translation file. A local boot of the API on Node 22, followed by
GET /api, is what caught it, while preparing the API’s move to Node 22
(TUN-897).
DO’s /api health check would most likely have stopped the deploy before it
took traffic. That would still have meant a failed deploy on both iba-api and
iba-dev-api, with migrations already run.
Why it ships first
with has been supported since Node 20.10, so the fix deploys on the current
20.11.1 runtime without any Node change. The version bump follows in its own
PR, so if that deploy goes wrong, the runtime is the only change to suspect.