This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-20).
Problem
Pages that use top-level await (async modules / TLA) render empty content. The page module likely resolves to a Promise that is not being awaited before rendering, causing the page component and its data to be undefined or empty.
Expected: "hello"
Received: ""
// $('#app-value').text() is empty
Client-side rendering (CSR) also times out waiting for elements to appear.
Estimated Impact
~6 test failures.
Affected Test Suites
test/e2e/async-modules/index.test.ts (6 failures)
Recommendation
-
Reproduce first in vinext's own test suite. Add a test with a page module that uses const data = await fetchSomething() at the top level and verify the page renders with the fetched data. Confirm it renders empty.
-
Ensure async module imports are awaited. The SSR/RSC entry needs to await the module import for pages that use top-level await. Check whether Vite/Rolldown handles async module resolution during SSR, or if vinext needs to explicitly handle this in its entry generation code.
-
Check the Vite build output. Verify whether Rolldown preserves top-level await in the SSR bundle and whether the entry properly awaits the module before accessing its exports.
Problem
Pages that use top-level
await(async modules / TLA) render empty content. The page module likely resolves to a Promise that is not being awaited before rendering, causing the page component and its data to beundefinedor empty.Client-side rendering (CSR) also times out waiting for elements to appear.
Estimated Impact
~6 test failures.
Affected Test Suites
test/e2e/async-modules/index.test.ts(6 failures)Recommendation
Reproduce first in vinext's own test suite. Add a test with a page module that uses
const data = await fetchSomething()at the top level and verify the page renders with the fetched data. Confirm it renders empty.Ensure async module imports are awaited. The SSR/RSC entry needs to
awaitthe module import for pages that use top-levelawait. Check whether Vite/Rolldown handles async module resolution during SSR, or if vinext needs to explicitly handle this in its entry generation code.Check the Vite build output. Verify whether Rolldown preserves top-level
awaitin the SSR bundle and whether the entry properly awaits the module before accessing its exports.