Simple Fix Long Page Compile Times When You Upgrade To Next Js 14
Ғылым және технология
I recently upgraded to next js 14 for my side porject. But my page compile times locally were extremely slow taking longer than 11 seconds 12 seconds. I upgraded my node version to fix this and thought I might share it incase it fixes it for other people as well.
Maybe its just a problem with the upgrade itself and theyll fix it in future updates.
But hope it helps you :D
Пікірлер: 13
That one jobless friend who codes and said “look, look what just I found”😂
Worked properly after I changed the node version. Thanks a lot!
I was on exactly 18.17.0 and moved to 20.9.0 and it made absolutely no difference. My initial compile time was 26.9s and after changing versions it was also exactly 26.9s
@uhtfvtwsgtgf
25 күн бұрын
bro did u fixed it. I am facing same problem
@reprovedcandy
24 күн бұрын
@@uhtfvtwsgtgf I did actually. The issue ended up being with my antivirus software. I don't remember exactly where I went but there's a way you should be able to tell your antivirus to exclude checking certain folders. Tell it to exclude the folder containing your next.js project and it will run at the correct speed. Lmk if this solution works for you, I bet its the same issue.
Mine was slow because of the old @next/font after the upgrade. Luckily sorting this out was quick
The best speed improvement that I recently found is to use the turbo mode. On the package json scripts use dev: next dev --turbo
@user-sq8gf9jq9j
27 күн бұрын
Yes, --turbo is much faster, but I have an issue with non-English characters such as japan, korea, china, russia when they are present in a file with 'use client'. Then, when we edit the code in that file, instead of hot reload, it reloads the page every time. Do you experience the same?
@sphorb
27 күн бұрын
Yeah turbo is by far the best. I recorded this video because the load times were extremely slow, I'm talking greater than 10 seconds. Upgrading npm package made them normal again
I was on Node js v20.11.0 and i upgraded to v20.11.1. Now my pages load faster and it seems the solution is to always upgrade my node js version to the latest, but how will I take care of that after deployment? Anyway the video was helpful and I just became a subscriber.
@sphorb
2 ай бұрын
Thank you:)
not working for me using node 20.12 v
( 2998 modules, 3s ) I think it's still slow.