You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Next.js: removed script bodies can enqueue missing Flight placeholders #1441
When an attribute rewriter removes a script element, lol_html still invokes its text handler. If the removed body contains a Flight push, the Next.js stage queues a placeholder that never reaches output. A later Flight script then fails the response with:
Next.js RSC output contains an unknown generated placeholder
Example shape, with an attribute rewriter configured to remove the first script:
Aram reproduced this on main and the PR, with Next.js alone and with GTM, across all 174 two-way splits of his fixture. Browsers ignore inline bodies on scripts with a src, and Next.js does not normally emit this shape. This issue records his reproduction; it has not been independently rerun during the review-thread follow-up.
Expected behavior
Removed elements must not enqueue Flight placeholders that cannot be emitted. Skip composed script stages for removed elements, or otherwise prevent their capture state from reaching the output stage.
Verification
Add a full HTML-processing regression with a removed script followed by a real Flight push. Cover Next.js alone and mixed Next.js/GTM, fragment boundaries, complete output, and no unresolved placeholders. Keep existing strict errors for genuinely lost placeholders.
Activity