Next.js supports modern browsers with no required configuration. It also adds some polyfills by default.
If your own code or any external npm dependencies require features not supported by your target browsers, you need to add polyfills yourself.
In this case, you should add a top-level import for the specific polyfill you need in your root layout or the individual component.
Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-polyfills with-polyfills-appyarn create next-app --example with-polyfills with-polyfills-apppnpm create next-app --example with-polyfills with-polyfills-appDeploy it to the cloud with Vercel (Documentation).