[BUGFIX beta] Update router.js.

Fixes #5584.