Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed May 3, 2023
1 parent 2a3b8b2 commit 7bcd504
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/next/src/server/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,15 @@ export class NextServer {
}
}

// When running as a custom server with app dir, we must set this env
// to correctly alias the React versions.
if (conf.experimental.appDir) {
process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = conf.experimental
.serverActions
? 'experimental'
: 'next'
if (this.options.customServer !== false) {
// When running as a custom server with app dir, we must set this env
// to correctly alias the React versions.
if (conf.experimental.appDir) {
process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = conf.experimental
.serverActions
? 'experimental'
: 'next'
}
}

this.server = await this.createServer({
Expand Down

0 comments on commit 7bcd504

Please sign in to comment.