Skip to content

Commit

Permalink
Fix suspense/hydration bug (on canary) (#2785)
Browse files Browse the repository at this point in the history
(patch)
  • Loading branch information
flybayer committed Oct 2, 2021
1 parent 25782cd commit 5105ed4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/auth/cypress/integration/index.test.ts
Expand Up @@ -23,6 +23,7 @@ describe("index page", () => {

cy.location("pathname").should("equal", "/")
cy.contains("button", "Logout")
cy.wait(1000)
})

it("allows the user to log in", () => {
Expand All @@ -42,6 +43,7 @@ describe("index page", () => {
cy.location("pathname").should("equal", "/")
cy.wait(1000)
cy.contains("button", "Logout")
cy.wait(1000)
})

it("allows the user to logout", () => {
Expand Down
4 changes: 4 additions & 0 deletions nextjs/packages/next/build/webpack-config.ts
Expand Up @@ -258,6 +258,10 @@ export default async function getBaseWebpackConfig(
semver.coerce(reactDomVersion)?.version === '18.0.0')) ||
hasReactExperimental // blitz
const hasReactRoot: boolean = config.experimental.reactRoot ?? hasReact18
// Have to set this suspense env for the actual build, because the webpack
// string replace below only affects the build output, not anything during
// the build like static page optimization
process.env.__BLITZ_SUSPENSE_ENABLED = String(hasReactRoot)

const babelConfigFile = await [
'.babelrc',
Expand Down

0 comments on commit 5105ed4

Please sign in to comment.