Next.js Discord

Discord Forum

Getting a list of compiled modules in dev mode

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
My next dev server is especially slow with app router in dev mode (compiling ~5000 modules). Is there a way to see a list of what modules it's compiling when running dev mode?

8 Replies

Northeast Congo Lion
would be interested in this as well. dev server is painfully slow
Transvaal lionOP
I ended up making a shell script to log all the files in the .next directory, and I run it whenever I want to compare.
#!/bin/bash

# Define the desktop path
folder=~/Sites/your-project/.next

# Write the recursive file list to the output file
find "${folder}" -type f | pbcopy
Searching through lists of files isn't very clear, but it's better than nothing. But I'd still really love a legit solution to visibility into what's happening during dev mode.
@Northeast Congo Lion would be interested in this as well. dev server is painfully slow
Holland Lop
from personal experience, try turbopack. on my old dev laptop it’s helped improve speeds a lot for me. it’s next dev —turbo, it’s a little experimental still and doesn’t work on some machines.
Northeast Congo Lion
Yeah I’ve tried it on new projects. We have a decent size app right now - turbo just gets stuck compiling.

I’ve narrowed down the issue to a third party component which we can’t really remove unfortunately.
Holland Lop
ah yeah, i've tried turbopack on my main desktop on the same project in which turbopack worked on my laptop, and i had the same infinite compilation issue. hopefully they'll improve it in a future release.
i honestly think the only other way to improve speeds is uninstalling unused dependencies. if you really just have thousands and using all of them, there might not be a way to optimize things.
Transvaal lionOP
--turbo makes things faster in certain configurations, but doesn't work in others (same infinite compilation issue). But it's still doing way too much work. I should be building closer to 500 modules, not 5000, and I wish there was a way to know what the extraneous work actually is. As of now, I'm mostly fumbling around in the dark poking at random things.