diff --git a/packages/next/server/base-server.ts b/packages/next/server/base-server.ts index 92f555cabff3..56f0dedf8a1d 100644 --- a/packages/next/server/base-server.ts +++ b/packages/next/server/base-server.ts @@ -1177,8 +1177,11 @@ export default abstract class Server { if (opts.supportsDynamicHTML === true) { const isBotRequest = isBot(req.headers['user-agent'] || '') const isSupportedDocument = - !!(components.Document as any)?.__next_internal_document || - typeof components.Document?.getInitialProps !== 'function' + typeof components.Document?.getInitialProps !== 'function' || + // When concurrent features is enabled, the built-in `Document` + // component also supports dynamic HTML. + (this.renderOpts.reactRoot && + !!(components.Document as any)?.__next_internal_document) // Disable dynamic HTML in cases that we know it won't be generated, // so that we can continue generating a cache key when possible.