Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEXT-1139] [BUG] Very long dev builds 50 times slower #46884

Closed
1 task done
OlegLustenko opened this issue Mar 7, 2023 · 14 comments
Closed
1 task done

[NEXT-1139] [BUG] Very long dev builds 50 times slower #46884

OlegLustenko opened this issue Mar 7, 2023 · 14 comments
Assignees
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team.

Comments

@OlegLustenko
Copy link

OlegLustenko commented Mar 7, 2023

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 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.14.0
      npm: 9.4.1
      Yarn: 1.22.19
      pnpm: 7.25.0
    Relevant packages:
      next: 13.2.4-canary.5
      eslint-config-next: 13.1.6
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

can I add this later?

To Reproduce

Our application heavily using rewrites, it might be the case

  • Update to latest next.js
  • npm run dev, track compilation time

Describe the Bug

Compilation takes too much time

13.1.6
image

13.2.2+, also tested on canary builds
image

Expected Behavior

It takes less or the same amount of time

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-1139

@OlegLustenko OlegLustenko added the bug Issue was opened via the bug report template. label Mar 7, 2023
@red1
Copy link

red1 commented Mar 7, 2023

I had a similar issue on a Mac Book Pro M2, I had to deactivate SWC in next.config.js

@OlegLustenko
Copy link
Author

@red1 thanks for reporting! it's awesome! It helps to allocate the problem space a lot

@OlegLustenko OlegLustenko changed the title [BUG] Very long dev builds [BUG] Very long dev builds 50 times slower Mar 7, 2023
@zdraffko
Copy link

zdraffko commented Mar 8, 2023

I am experiencing the same issue with Next.js 13 on Windows 11.

@ijjk
Copy link
Member

ijjk commented Mar 8, 2023

Hi, could you try removing any previous changes to next.config.js and only set experimental: { swcFileReading: false } to confirm whether it's related to that or not?

@OlegLustenko
Copy link
Author

@ijjk oh wow! Thanks for the quick response, and even more, it helped!

image

Can I treat it as a recommendation as-of-now?

@ijjk
Copy link
Member

ijjk commented Mar 10, 2023

For now yes, we will investigate further!

@OlegLustenko
Copy link
Author

More info after fresh npm install it still reproduced even with a flag

image

@OlegLustenko
Copy link
Author

It still fantomly reproduced even with swcFileReading :(

It's a hard blocker for us and we have to revert back 13.1.6

@OlegLustenko
Copy link
Author

@ijjk, do we need to add some bug tags so it's not lost visibility?

The thing is in 13.2.x versions rewrites fixed for appDir

@kdy1 kdy1 self-assigned this Mar 30, 2023
@SilentDepth
Copy link

Facing the same issue here. I did some little experiments in my Next.js + Tailwind CSS project and found that if I use brace expansion in the middle part of paths in Tailwind CSS content option, like ./{components,pages}/**/*.jsx, then next dev will take a very long time to compile. Splitting it into several patterns (e.g. ['./components/**/*.jsx', './pages/**/*.jsx']) solves my problem.

@wh5938316
Copy link

Is there any update on this? I am experiencing a similar issue where my dev builds are very slow on my Mac Pro M1. This issue occurs when using versions of Next.js above 13.2.4, so I have had to lock my version to 13.2.4.

@wadehammes
Copy link

wadehammes commented May 5, 2023

Not sure if related, but I am getting this now like every build and my builds are 3x longer than they use to be to Vercel:

image

Some times it wont happen but they are still very long build times.

Avg build for our 1700 pages use to be 9-11min, now its taking 24min. I even went in and optimized over 100 images our marketing team had uploaded to our Contentful that were huge, shaving off roughly 200MB (yikes, I know).

@timneutkens timneutkens added the linear: next Confirmed issue that is tracked by the Next.js team. label May 10, 2023
@timneutkens timneutkens changed the title [BUG] Very long dev builds 50 times slower [NEXT-1139] [BUG] Very long dev builds 50 times slower May 10, 2023
@timneutkens
Copy link
Member

Hey, can you share the .next/trace file when running on the previous version and then upgrade and share the trace file for that too. Then we can at least get some insight into what's different as there is no reproduction provided.

@timneutkens
Copy link
Member

Closing this issue to consolidate the same reports here: #48748 (comment).
Please follow the steps provided in order for us to investigate further.

@vercel vercel locked and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team.
Projects
None yet
Development

No branches or pull requests

9 participants