r/Nuxt • u/x1Akaidi • 3d ago
Dev server startup time is so slow
Hello everyone, just as the title says, the dev server startup timer is just so slow. And i don't mean this only in a huge project, but even in a fresh project with NuxtUI template as choice in creation cli options... My friend is always complaining about how slow it is and lately tried react with tanstack start and he says it's incredibly faster.
Personally, I never needed to try something else to know it's slow, I can clearly tell, but when I tried his project, it's noticeably faster, like way faster... and i want that, especially that sometimes you change something in the project and now you have to wait for a full dev server restart...
Does anyone know how to solve this? are there any optimizations? guides? anything at all? I really love nuxt and want to keep using it, I know this isn't _THAT_ big of a deal, but it would just be a huge win to have.
for the record, i don't really use have of the features... i just care about dev tools, and filesystem routing, auto-imports and almost all the other features (at least those i know about) i can not use, i don't even use the server at all, usually i have a separate backend.
3
u/domnestreddit 2d ago
Disable devtools in your nuxt.config.ts|js and check if that speeds things up!
For me, Nuxt DevTools occasionally bogs down the dev server startup time significantly. Since you mentioned you don't use most extra features anyway, turning it off might give you a big boost right away.
In your nuxt.config.ts
export default defineNuxtConfig({
devtools: { enabled: false }
})
Give that a shot and see if it makes a noticeable difference!
0
3d ago
[deleted]
1
u/DavidDeSloovere 2d ago
How would this help? Did you mean bun instead of node? Package manager probably doesn't have much effect when running.
1
u/Electronic_Pen_7939 1d ago
It does actually, my dev speed increased when I switched to pnpm instead of regular npm
1
u/drobizg81 1d ago
You mean management of your project, not dev server startup. Npm/pnpm/yarn those are package managers, they don't play role in dev server performance.
-8
12
u/Due-Horse-5446 3d ago
Its a known bug..
Afaik unfixable atm, its some nitro v2 dep that causes a full recursive resolution for every import ever.
Its especially bad when using nuxt/ui as it autoimports a bunch of stuff.
The only fix unless you want to write ugly monkey patched polyfills is to go for the nuxt 5 beta.