seldebrings / next-cognito-ssr-auth

NextJS SSR AWS Cognito JWT Authentication
9 stars 2 forks source link

Warning: viewport meta tags should not be used in _document.js's <Head>. https://err.sh/next.js/no-document-viewport-meta #2

Closed Rashmi-278 closed 3 years ago

Rashmi-278 commented 3 years ago

This warninng is resolved by following this solution mentioned in https://github.com/vercel/next.js/issues/13230

comment out the meta tag in _document.js (where { Head } is imported from "next/document")...

{/* */}

...and add it in a new Head component in index.js (importing Head from "next/head")...

export default () => ( <>

<Viewport />
<Environment />

</> ) ...it works correctly! Only the correct viewport element shows up on the page.

vercel/next.js/issues/13230