Next js app loading very slow in development enviorment

6k Views Asked by At

I am developing next js application and in development enviroment it takes lot of time to load, The page goes unresponsive in the start and then if I cancel the request it stop loading, after refreshing it loads immediately. I am using material ui and few other smaller packages, my apis are not slow and neither i am using big libraries or packages.

1

I am trying to create next js application but response time is very slow

1

There are 1 best solutions below

0
Mohamed Shehaby On

Turbopack can be used in Next.js in both the pages and app directories for faster local development. To enable Turbopack, use the --turbo flag when running the Next.js development server.

{
  "scripts": {
    "dev": "next dev --turbo",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  }
}

It will make your dev mode a lot faster

For more info https://turbo.build/pack/docs/features https://nextjs.org/docs/architecture/turbopack