Problems with turbopack in dev development being way too slow, taking 25 seconds for page to fully compile #85744
              
                Unanswered
              
          
                  
                    
                      gustavotrapp
                    
                  
                
                  asked this question in
                Help
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm currently building a very complex page, which is essentially a dynamic dashboard builder, sort of like Grafana or Metabase. The page loads are taking forever, and with this page in specific, it takes a long time. But every single other page that we have in our application also takes a ridiculous amount of time. It takes anywhere from 15 seconds to, in this case, 25 seconds. When my machine is very slow, it can take up to a minute really, but in this case, it took 25 seconds, and the experience is complete trash. The dev server keeps restarting, and I'm just looking for a way of getting better performance. How can I optimize this? Is this really just a limitation? What can I do?
Yes I'm using Turbopack
Yes I've read https://nextjs.org/docs/app/guides/local-development
No I can't really share much code, but the compiled build of the page is approximately ~2.5MBs
Other pages are around ~500kBs
Video showing the turbopack-trace: https://www.loom.com/share/4e0aa5c58ea14bd8a03d892c5a85319e
Project setup
Our setup is essentially a monorepo with Turborepo and we have a apps/ folder which has just our Next.js application with another service that we have that's an internal service. Then in our packages we have our tRPC package, a db package and a few other utility packages. Essentially, what we do is we always compile our packages so that our typescript performance isn't bad when we use it in our Next.js app. Then we essentially just import it all as a private internal module.
Weird bugs
Additionally, I think it's important to mention that sometimes I have to restart my MacBook after developing for a long time because the HMR in hotreload just doesn't work anymore. I mean, I get a HMR error in the terminal saying that something failed, but I have no idea what, and it just doesn't work. The refresh doesn't work. I make a change, it doesn't reflect. It's extremely weird.
Additional information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:39 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8103
Available memory (MB): 8192
Available CPU cores: 8
Binaries:
Node: 20.19.5
npm: 10.9.2
Yarn: 1.22.22
pnpm: 10.7.1
Relevant Packages:
next: 16.0.1
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: N/A
Next.js Config:
output: standalone
Example
I can't provide this because it's internal code from our organization.
Beta Was this translation helpful? Give feedback.
All reactions