async function load_nearest_error_page(i, branch, errors) {
	while (i--) {
		if (errors[i]) {
			let j = i;
			while (!branch[j]) j -= 1;
			try {
				return {
					idx: j + 1,
					node: {
						node: await /** @type {import('types').CSRPageNodeLoader } */ (errors[i])(),
						loader: /** @type {import('types').CSRPageNodeLoader } */ (errors[i]),
						data: {},
						server: null,
						universal: null
					}
				};
			} catch {
				continue;
			}
		}
	}
}
@param {number} i Start index to backtrack from
@param {Array<import('./types.js').BranchNode | undefined>} branch Branch to backtrack
@param {Array<import('types').CSRPageNodeLoader | undefined>} errors All error pages for this branch
@returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>}