From 3c5d5b55c39ff120245b3404bc7891820dd285dd Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 3 Nov 2021 13:28:47 -0500 Subject: [PATCH] Add note about HMR WebSocket with express to upgrading (#30905) x-ref: https://github.com/vercel/next.js/issues/30491#issuecomment-957865735 ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` --- docs/upgrading.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/upgrading.md b/docs/upgrading.md index 55c7c39d3128e..15281fdcbb269 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -71,6 +71,14 @@ location /_next/webpack-hmr { } ``` +For custom servers, such as `express`, you may need to use `app.all` to ensure the request is passed correctly, for example: + +```js +app.all('/_next/webpack-hmr', (req, res) => { + nextjsRequestHandler(req, res) +}) +``` + ### Webpack 4 support has been removed If you are already using webpack 5 you can skip this section.