Next 14 is painfully slow #58889
-
SummaryRecently, i feel like nextjs is getting slower... like a LOT slower, back in next 12 hot reload and response times where around 300ms to 1.1 seconds MAX. Now, just starting the server takes 15 seconds, and generating a single response its taking nearly a minute (sometimes more) and hmr flat out just doesnt work whatsoever. Ive tried using turbo but I dont think it works with my current stack. Is this just me, or is this happening for everyone? Could it be due to the dependencies im using being chunky? (heres my package.json) {
"name": "storygem",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "next build",
"db:push": "dotenv drizzle-kit push:mysql",
"db:studio": "dotenv drizzle-kit studio",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@planetscale/database": "^1.11.0",
"@t3-oss/env-nextjs": "^0.7.0",
"@tanstack/react-query": "^4.32.6",
"@trpc/client": "^10.37.1",
"@trpc/next": "^10.37.1",
"@trpc/react-query": "^10.37.1",
"@trpc/server": "^10.37.1",
"@types/ua-parser-js": "^0.7.39",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"drizzle-orm": "^0.28.5",
"editor": "workspace: *",
"lucide-react": "^0.292.0",
"next": "^14.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"superjson": "^1.13.1",
"tailwind-merge": "^2.0.0",
"tailwindcss-animate": "^1.0.7",
"ua-parser-js": "^1.0.37",
"ui": "workspace: *",
"zod": "^3.22.4"
},
"devDependencies": {
"@types/eslint": "^8.44.2",
"@types/node": "^18.16.0",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"autoprefixer": "^10.4.14",
"configs": "workspace: *",
"dotenv-cli": "^7.3.0",
"drizzle-kit": "^0.19.13",
"eslint": "^8.47.0",
"eslint-config-custom": "workspace:*",
"eslint-config-next": "^14.0.3",
"mysql2": "^3.6.1",
"postcss": "^8.4.27",
"prettier": "^3.0.0",
"prettier-plugin-tailwindcss": "^0.5.1",
"tailwindcss": "^3.3.5",
"tsconfig": "workspace:*",
"typescript": "^5.1.6"
},
"ct3aMetadata": {
"initVersion": "7.23.1"
},
"packageManager": "[email protected]"
} Additional informationOperating System:
Platform: linux
Arch: x64
Version: #1 SMP Thu Oct 5 21:02:42 UTC 2023
Binaries:
Node: 21.1.0
npm: 10.2.0
Yarn: 1.22.18
pnpm: 8.10.2
Relevant Packages:
next: 14.0.3
eslint-config-next: 14.0.3
react: 18.2.0
react-dom: 18.2.0
typescript: 5.2.2
Next.js Config:
output: N/A
Running on WSL ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 5 replies
-
I have been having similar issues |
Beta Was this translation helpful? Give feedback.
-
Same issue here. It is ridiculously slow. And we just moved from another framework that was very fast |
Beta Was this translation helpful? Give feedback.
-
10~s cold start time for an app with 4 routes ! |
Beta Was this translation helpful? Give feedback.
-
I've narrowed down the issue a bit. It seems to specifically be slow on Windows WSL. when I run Another fix was to use bun use |
Beta Was this translation helpful? Give feedback.
-
We see that also in production on vercel - the TTFB is a real pain! Edge functions, streaming, everything sounds so good, but in reality, this all sounds like BS.. its hard to compete to a single location PHP page currently :( hard to admit. |
Beta Was this translation helpful? Give feedback.
-
Facing same issue beacause of Lucide React with dynamic imports. |
Beta Was this translation helpful? Give feedback.
-
it's very big problem I created 4 web app at the same time in NextJS 14 and now I am in trouble. i will never use NextJs again, never ever. |
Beta Was this translation helpful? Give feedback.
-
same issue here. the hmr took like ~50s for some small changes. the ssr/streaming things are not so good, especially for some pure frontend stuff. |
Beta Was this translation helpful? Give feedback.
-
The solution is to move the project folder into the WSL folder itself. Apparently HMR and hot reloading in general is broken in WSL when trying to watch files in the windows file system. The problem seems to resolve itself after moving all my projects directly onto the linux filesystem For most people your linux file system home folder should be at |
Beta Was this translation helpful? Give feedback.
The solution is to move the project folder into the WSL folder itself. Apparently HMR and hot reloading in general is broken in WSL when trying to watch files in the windows file system. The problem seems to resolve itself after moving all my projects directly onto the linux filesystem
For most people your linux file system home folder should be at
\\wsl.localhost\