Skip to content

Commit

Permalink
fix dynamic html condition
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Mar 11, 2022
1 parent 65e5b60 commit 54da6d0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/next/server/base-server.ts
Expand Up @@ -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.
Expand Down

0 comments on commit 54da6d0

Please sign in to comment.