Next.js Discord

Discord Forum

My NextJS is super slow in dev mod ( a little less with turbo but some bugs pop up )

Unanswered
Red-cockaded Woodpecker posted this in #help-forum
Open in Discord
Red-cockaded WoodpeckerOP
Hello !

I've been doing next for a while, I'm still learning a lot of things and I'm currently working on a big personal project, much bigger than the simple things I've been doing in next until now, and I realize that the transition between pages is quite long ( when they haven't been hidden yet ). If I f5 the page, the page no longer responds.

It's likely that this is due to a poor construction of my app, but if not, does this tell you anything about a super-slow nextjs dev mod on rather large projects?

If you have any tips for optimizing next I'd love to hear from you!

my front-end stack :

Next,
Shadcn,
Talwind,
TanstackQuery.


Thanks in advance!

5 Replies

Red-cockaded WoodpeckerOP
Good evening @Turkish Van I don't use svg ( I use the lucid icon lib, maybe it injects some ) I'm wondering, when I go from one page to the next the compilation is super long, could it be possible that the import of dependencies for the page is the cause of this slowdown, I export my components / utility functions / hooks etc.. with index.ts so as not to have tens and tens of lines of import in my components.
@Red-cockaded Woodpecker Good evening <@439879724412567553> I don't use svg ( I use the lucid icon lib, maybe it injects some ) I'm wondering, when I go from one page to the next the compilation is super long, could it be possible that the import of dependencies for the page is the cause of this slowdown, I export my components / utility functions / hooks etc.. with index.ts so as not to have tens and tens of lines of import in my components.
Turkish Van
I am not really sure what exactly do You mean by exporting all the components through the index.ts.

Have You checked the network requests while the slow loading page is being loaded? It might be one of the requests taking a bit longer to execute which may result in whole page being stuck.
@Turkish Van I am not really sure what exactly do You mean by exporting all the components through the `index.ts`. Have You checked the network requests while the slow loading page is being loaded? It might be one of the requests taking a bit longer to execute which may result in whole page being stuck.
Red-cockaded WoodpeckerOP
Hey, sorry I didn't see the ping..

What I find weird is that my api returns the data super fast.

But the compilation takes a long time... it's very random, sometimes it takes 1 to 2 seconds sometimes it takes more than 10 seconds
For example