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-22).
Problem
When a component is loaded via next/dynamic, the CSS it imports (global, CSS modules) is not injected into the page. Components fail to become visible (zero size due to missing styles), causing all 4 tests in the suite to time out waiting for elements.
waiting for locator('#server') to be visible — CSS for dynamic component never injected
Estimated Impact
~4 test failures across the deploy suite.
Affected Test Suites
test/e2e/app-dir/next-dynamic-css/next-dynamic-css.test.ts (4 failures)
Recommendation
-
Reproduce first in vinext's own test suite. Add a next/dynamic import of a component that imports a CSS module and assert the rendered text is visible (i.e. CSS was applied).
-
Inject the dynamic component's CSS on load. When the dynamic chunk loads, append its associated CSS to the document. Use Vite's CSS asset metadata.
Part of #1328.
Problem
When a component is loaded via
next/dynamic, the CSS it imports (global, CSS modules) is not injected into the page. Components fail to become visible (zero size due to missing styles), causing all 4 tests in the suite to time out waiting for elements.Estimated Impact
~4 test failures across the deploy suite.
Affected Test Suites
test/e2e/app-dir/next-dynamic-css/next-dynamic-css.test.ts(4 failures)Recommendation
Reproduce first in vinext's own test suite. Add a
next/dynamicimport of a component that imports a CSS module and assert the rendered text is visible (i.e. CSS was applied).Inject the dynamic component's CSS on load. When the dynamic chunk loads, append its associated CSS to the document. Use Vite's CSS asset metadata.
Part of #1328.