Search code examples
javascriptreactjsnext.jscomponents

Warning in console using Next.js 13


Well, I'm using Next js 13 to develop a website, but for some reason I'm having this warning in console The resource http://localhost:3000/_next/static/chunks/polyfills.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

I've tried to remove Links and see if any Image file it's giving problems but any of this helped.


Solution

  • The problem is with the

     import { Inter } from 'next/font/google'
    

    Changed this from :

    import './globals.css'
    import { Inter } from 'next/font/google'
    
    const inter = Inter({ subsets: ['latin'] })
    
    export const metadata = {
      title: 'Create Next App',
      description: 'Generated by create next app',
    }
    
    export default function RootLayout({ children }: { children: React.ReactNode}) {
      
      return (
        <html lang="en">
          <body className={inter.className}>{children}</body>
        </html>
      )
    }
    

    to :

    import './globals.css'
    
    export const metadata = {
      title: 'Create Next App',
      description: 'Generated by create next app',
    }
    
    export default function RootLayout({ children }: { children: React.ReactNode }) {
    
      return (
        <html lang="en">
          <body >
            {children}
          </body>
        </html>
      )
    }
    

    The problem is gone for now! I think in development mode, nextjs preloads css for speedy development and while hot reloading and it does that preloading continuously after every change! Hope to see this problem fixed soon by vercel