Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update renderOpts.dev handling and fix check #36666

Merged
merged 7 commits into from May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/next/server/base-server.ts
Expand Up @@ -341,6 +341,7 @@ export default abstract class Server<ServerOptions extends Options = Options> {
? this.nextConfig.crossOrigin
: undefined,
reactRoot: this.nextConfig.experimental.reactRoot === true,
dev,
}

// Only the `publicRuntimeConfig` key is exposed to the client side
Expand Down
1 change: 0 additions & 1 deletion packages/next/server/dev/next-dev-server.ts
Expand Up @@ -139,7 +139,6 @@ export default class DevServer extends Server {

constructor(options: Options) {
super({ ...options, dev: true })
this.renderOpts.dev = true
;(this.renderOpts as any).ErrorDebug = ReactDevOverlay
this.devReady = new Promise((resolve) => {
this.setDevReady = resolve
Expand Down
18 changes: 11 additions & 7 deletions packages/next/server/next-server.ts
Expand Up @@ -126,15 +126,19 @@ export default class NextNodeServer extends BaseServer {
)
}

if (!this.renderOpts.dev) {
if (!options.dev) {
// pre-warm _document and _app as these will be
// needed for most requests
loadComponents(this.distDir, '/_document', this._isLikeServerless).catch(
() => {}
)
loadComponents(this.distDir, '/_app', this._isLikeServerless).catch(
() => {}
)
try {
loadComponents(
this.distDir,
'/_document',
this._isLikeServerless
).catch(() => {})
loadComponents(this.distDir, '/_app', this._isLikeServerless).catch(
() => {}
)
} catch (_) {}
ijjk marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down