question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compilation time extremely slow (Next > 12.0.9)

See original GitHub issue

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 20.6.0: Tue Feb 22 21:10:42 PST 2022; root:xnu-7195.141.26~1/RELEASE_ARM64_T8101
Binaries:
  Node: 16.14.2
  npm: 8.5.0
  Yarn: 1.22.18
  pnpm: N/A
Relevant packages:
  next: 12.2.3-canary.4
  eslint-config-next: 11.1.3-canary.7
  react: 17.0.2
  react-dom: 17.0.2

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

After updating the next package from version 12.0.9 to 12.2.0 and above, the next dev compilation time extremely slow. I tried to use compilation with SWC and with babel, the result is the same.

nextjs 12.0.9: compiled client and server successfully in 3.4s (577 modules) trace: https://gist.github.com/R1ZEN/2d032dba11947ac3b48ecfe9a4e1008d

nextjs 12.2.0: compiled client and server successfully in 46.8s (667 modules) trace: https://gist.github.com/R1ZEN/36445c707eb0e50a58cccd05af2ac19f

Expected Behavior

Compilation time would be the same or faster

Link to reproduction

I don’t have a reproduction that I can share at the moment

To Reproduce

I don’t have a reproduction that I can share at the moment, but might have some time to come up with one.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sebastienbarrecommented, Sep 6, 2022

I noticed the exact same thing running dev now. I upgraded from 12.1.5 to 12.2.5, I now see two " compiled client and server successfully", the second one much MUCH slower than the first – we are talking more than x50 to x100 times slower, almost 2 minutes, my build takes only about 7 seconds in comparison.

@balazsorban44 This is also on MacOS. More specifically, MacOS 12.3.1 (Monterey) with a MacBook Pro (16-inch, 2021) M1 Max.

Essentially the exact same thing as reported in Why does it compile twice? (second time always much slower) · Discussion #39901 · vercel/next.js

event - compiled client and server successfully in 241 ms (193 modules)
wait  - compiling...
event - compiled client and server successfully in 113s (193 modules)

UPDATE: I downgraded and locked to 12.2.4 and this slowdown is gone, so this “issue” seems to have been introduced in 12.2.5

1reaction
sebastienbarrecommented, Sep 12, 2022

@ijjk Thanks, this is solving the issue for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blog - Next.js 12
Next.js 12 introduces a brand-new Rust compiler, Middleware (beta), React 18 Support, Native ESM Support, URL Imports, React Server ...
Read more >
next.js build times are slow. How can I make them faster?
npm run dev simply runs next and next takes around 50 seconds to become responsive (just after the compiled successfully is printed. This...
Read more >
Latest version: build is extremely slow and it is hurting ... - MSDN
Hi all,. After updating to latest stable build on both my Mac and Visual Studio machine, the time it takes to build and...
Read more >
Is C++ Really This SLOW in Unreal 4?
Something seems off. With my projects(average size, not too big or small) it usually takes 10-30 sec to compile. I have i7-4770k and ......
Read more >
next - NPM Package Overview - Socket - Socket.dev
Next.js is a minimalistic framework for server-rendered React applications. ... Next.js uses a constant generated at build time to identify which version of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found