diff --git a/server/document.js b/server/document.js index 315a8cca..06df652e 100644 --- a/server/document.js +++ b/server/document.js @@ -195,7 +195,7 @@ export class NextScript extends Component { } ${page === '_error' && ` - __NEXT_REGISTER_PAGE('${pathname}', function() { + __NEXT_REGISTER_PAGE('${htmlescape(pathname)}', function() { var error = new Error('Page does not exist: ${htmlescape(pathname)}') error.statusCode = 404