Hello,
I added a script to my root layout according to the documentation, but I'm getting an error. Do i need to create a separate <Head> tag and put the script there?
hook.js:608 Warning: Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag. Error Component Stack
on-recoverable-error.js:20 Uncaught Error: Hydration failed because the initial UI does not match what was rendered on the server.
export default async function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html
className={robotoFlex.className}
suppressHydrationWarning={true}>
<body
className='bg-sc-light-bg text-foreground'
suppressHydrationWarning={true}>
<Providers>
<Navbar />
<GlobalLoader />
{children}
</Providers>
</body>
<Script
src={`https://cdn-cookieyes.com/client_data/${COOKIEYES_ID ?? ''}/script.js`}
strategy='beforeInteractive'
/>
</html>
)
}