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

Revert "Revert "Refactor Server Router" (#40328)" #40333

Merged
merged 2 commits into from Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion packages/next/server/base-server.ts
Expand Up @@ -959,7 +959,11 @@ export default abstract class Server<ServerOptions extends Options = Options> {

// Toggle whether or not this is a Data request
const isDataReq =
!!(query.__nextDataReq || req.headers['x-nextjs-data']) &&
!!(
query.__nextDataReq ||
(req.headers['x-nextjs-data'] &&
(this.serverOptions as any).webServerConfig)
) &&
(isSSG || hasServerProps || isServerComponent)

delete query.__nextDataReq
Expand Down
1 change: 0 additions & 1 deletion packages/next/server/dev/next-dev-server.ts
Expand Up @@ -221,7 +221,6 @@ export default class DevServer extends Server {
for (const path in exportPathMap) {
const { page, query = {} } = exportPathMap[path]

// We use unshift so that we're sure the routes is defined before Next's default routes
this.router.addFsRoute({
match: getPathMatch(path),
type: 'route',
Expand Down