diff --git a/packages/next/server/render.tsx b/packages/next/server/render.tsx
index 7d88ecd1a806a3b..196d88ae3c312fc 100644
--- a/packages/next/server/render.tsx
+++ b/packages/next/server/render.tsx
@@ -315,15 +315,12 @@ function renderDocument(
styles: docProps.styles,
head: docProps.head,
}
- return (
- '' +
- ReactDOMServer.renderToStaticMarkup(
-
-
-
-
-
- )
+ return ReactDOMServer.renderToStaticMarkup(
+
+
+
+
+
)
}
diff --git a/test/integration/production/test/index.test.js b/test/integration/production/test/index.test.js
index 591cba62d5b9047..0cc41f01f9a9a1a 100644
--- a/test/integration/production/test/index.test.js
+++ b/test/integration/production/test/index.test.js
@@ -917,6 +917,11 @@ describe('Production Usage', () => {
expect(missing).toBe(false)
})
+ it('should only have one DOCTYPE', async () => {
+ const html = await renderViaHTTP(appPort, '/')
+ expect(html).toMatch(/^ {
const browser = await webdriver(appPort, '/')