From 6639b8f2af4578a46f6d584aa31aed0c5bb73fd0 Mon Sep 17 00:00:00 2001 From: Luis Alvarez D Date: Wed, 15 Jul 2020 00:28:47 -0500 Subject: [PATCH] Find pages/_document.js chunk in development (#15172) Chunks already have a normalized path. Not sure if there are other chunks that require this change, I did a global search and didn't find similar cases. --- packages/next/server/hot-reloader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/server/hot-reloader.ts b/packages/next/server/hot-reloader.ts index ebdca5123fc4e..aab38b3a10f86 100644 --- a/packages/next/server/hot-reloader.ts +++ b/packages/next/server/hot-reloader.ts @@ -2,7 +2,7 @@ import { getOverlayMiddleware } from '@next/react-dev-overlay/lib/middleware' import { NextHandleFunction } from 'connect' import { IncomingMessage, ServerResponse } from 'http' import { WebpackHotMiddleware } from './hot-middleware' -import { join, normalize, relative as relativePath } from 'path' +import { join, relative as relativePath } from 'path' import { UrlObject } from 'url' import webpack from 'webpack' import { createEntrypoints, createPagesMapping } from '../build/entries' @@ -353,7 +353,7 @@ export default class HotReloader { // We only watch `_document` for changes on the server compilation // the rest of the files will be triggered by the client compilation const documentChunk = compilation.chunks.find( - (c) => c.name === normalize(`pages/_document`) + (c) => c.name === `pages/_document` ) // If the document chunk can't be found we do nothing if (!documentChunk) {