import script from 'next/script'


The best developer experience way I've found is to do this: https://github.com/vercel/next.js/blob/canary/packages/next/next-server/server/config.ts#L33, Hope this saves someone from hours of frustration that I endured coming up with this , With Next.js v11, you can use the Next component Script, https://nextjs.org/blog/next-11#script-optimization, Move your static folder into public folder in your root directory. The script is added after NextScript but nevertheless does not work. Next.js began as a React server-side rendering framework. google-tag-manager JS in second