Next.js Discord

Discord Forum

Stabilization and optimization

Unanswered
Cuban Crocodile posted this in #help-forum
Open in Discord
Cuban CrocodileOP
On the website I created using Next.js, when I check its performance with lighthouse, I get values between 30-40%. Does anyone have a suggestion to increase this?

27 Replies

lighthouse gives you the suggestions
Cuban CrocodileOP
I'm not getting the performance I want even though I make the suggestions
@joulev dev mode or prod mode
Cuban CrocodileOP
I developed the site with cursor, how do I command developer and prod mod through it
@Cuban Crocodile I developed the site with cursor, how do I command developer and prod mod through it
dev mode = npm run dev
prod mode = deploy on vercel or npm start or similar
@joulev dev mode = npm run dev prod mode = deploy on vercel or npm start or similar
Cuban CrocodileOP
Is it possible that when I deploy it in Vercel, its performance will improve? When it is like this on localhost
run it in prod mode in localhost you will see how it performs when deployed to vercel
@joulev run it in prod mode in localhost you will see how it performs when deployed to vercel
Cuban CrocodileOP
in prod mode everything shows 100%, but in npm run dev everything is underperforming
and contains more things than usual to give you proper error messages, stack traces, hot reloading etc
the real performance should always be tested with pnpm build && pnpm start
@Yi Lon Ma the real performance should always be tested with `pnpm build && pnpm start`
Cuban CrocodileOP
npm run build && npm run start
right
yes that's its npm equivalent
Cuban CrocodileOP
but this way I don't use /api/ either so I can't see the real result
Cuban CrocodileOP
The site I set up works like a marketplace, when I say npm run start
it does not pull data from the database
it does not pull data from database?
Cuban CrocodileOP
No, it doesn't pull in npm run start but it pulls in npm run dev
you get any error or something? or you mean the data does not update
Cuban CrocodileOP
I dont get any error, the page opens without any problem, it just doesn't pull data
there should be some errors or something to tell you the reason, could you send the screenshot of your terminal and browser console?
Cuban CrocodileOP
Discord, I don't see what that has to do with it
do you get this error in development aswell?
Cuban CrocodileOP
I get this error in f12 developer mode, I start the server without any problems, I can switch between pages but it does not pull anything from the database