Why is nextjs so slow all of a sudden
Answered
In&Out posted this in #help-forum
In&OutOP
Didn't do next in like a month, made new project, did some stuff and now everything is so much slower, when i refresh it takes too long, 90% of saving would end up in hard refresh, whats up?
Answered by Pearls
Theres a big chance that you have some bad code, for example:
A useEffect that does an api request, saves the result of it in an array, but the useEffect depency is also that result variable (infinite loop of api requests)
About the hard refresh, theres some sort of frontend error happening which results in a full rerender.
A useEffect that does an api request, saves the result of it in an array, but the useEffect depency is also that result variable (infinite loop of api requests)
About the hard refresh, theres some sort of frontend error happening which results in a full rerender.
17 Replies
Theres a big chance that you have some bad code, for example:
A useEffect that does an api request, saves the result of it in an array, but the useEffect depency is also that result variable (infinite loop of api requests)
About the hard refresh, theres some sort of frontend error happening which results in a full rerender.
A useEffect that does an api request, saves the result of it in an array, but the useEffect depency is also that result variable (infinite loop of api requests)
About the hard refresh, theres some sort of frontend error happening which results in a full rerender.
Answer
@Pearls Theres a big chance that you have some bad code, for example:
A useEffect that does an api request, saves the result of it in an array, but the useEffect depency is also that result variable (infinite loop of api requests)
About the hard refresh, theres some sort of frontend error happening which results in a full rerender.
In&OutOP
got none of them
for data i am using faker.js
i am using vivaldi, would that do something?
I mean, even if its data related, before it didnt take THIS much time
Could you share your project/code?
@In&Out i am using vivaldi, would that do something?
Uhm, it could, possibly? but its not likely
@Pearls Uhm, it could, possibly? but its not likely
In&OutOP
hmm, let me try
yeah, its browser
thats so weird....
@In&Out too big
im confused, you said you creatde a new project? either way you could just post the project on github. but thats fine ig
@In&Out yeah, its browser
that is very odd
@Pearls im confused, you said you creatde a new project? either way you could just post the project on github. but thats fine ig
In&OutOP
code is messy ngl lol,thats what i meant
Alright well, good luck with your project!
In&OutOP
thx m8