From 26efcc5ded3485b996a3652407924c157112ee07 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 26 Apr 2022 12:13:33 +0800 Subject: [PATCH] Fix missing interpolation on next/head exports (#36435) fixes https://github.com/vercel/next.js/issues/36183 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint` --- packages/next/head.js | 4 +++- test/e2e/type-module-interop/index.test.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/next/head.js b/packages/next/head.js index 71758fdbeaa5c..416086f7f97e9 100644 --- a/packages/next/head.js +++ b/packages/next/head.js @@ -1 +1,3 @@ -module.exports = require('./dist/shared/lib/head') +var head = require('./dist/shared/lib/head') +Object.assign(head.default, head) +module.exports = head.default diff --git a/test/e2e/type-module-interop/index.test.ts b/test/e2e/type-module-interop/index.test.ts index 9ebf5568d470e..46fb994b39c80 100644 --- a/test/e2e/type-module-interop/index.test.ts +++ b/test/e2e/type-module-interop/index.test.ts @@ -12,10 +12,23 @@ describe('Type module interop', () => { files: { 'pages/index.js': ` import Link from 'next/link' + import Head from 'next/head' + import Script from 'next/script' export default function Page() { return ( <> + + This page has a title 🤔 + + + +