-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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 14 Build Performance on Windows (outputFileTracing) #60754
Comments
@TheThirdRace I just opened an issue yesterday, about compilation time in wsl2, do it look related to your ? #61340 |
It's not related no. Your issue is about running the code ( |
@timneutkens @balazsorban44 This issue has plagued people since Nov 5, 2021 (#31021). We had a workaround in NextJs 14 with The issue on this page was my attempt to warn NextJs about the impending removal and the issues it would cause for some setup. Unfortunately, it has not been prioritized. The irony here is that the removal of the workaround was prioritized without having a solution first... Had no work been done at all about it, we'd all by happy 😥 My builds are now taking much longer since I've upgraded to NextJs 15. The numbers here are still relevant 2 years later: |
The deploy of my branch, with the upgrade to NextJs 15, failed. Apparently, not only the build now is 2x as long, but somehow 2 serverless functions are busting the size limit 🤔 Looking at the logs (will share at the end), I can see a few weird things:
Here's the complete log:
|
I found the problem for the deployment on Vercel issue: #60754 (comment) (just took me 15 hours 🙄) Because NextJs 15 removed The problem in my case was that This seemed to trigger an edge case bug in the automatic output file tracing, which included things like all the images in the project and some files from the
I can't explain exactly why it causes this, but as soon as I moved the local file imports inside the actual page that used these, the serverless outputs (ISR functions deployed on Vercel) went back to 4MB per page (compared to 300 MB to 1 GB with the bug). Thus, you want what's used in |
🚨 This is still unresolved While I could fix the deployment issue, the issue reported on this page (build times) is still well alive unfortunately. The build time is still twice as long as when The only way to get back the quicker builds would be to either:
I can add any NextJs person to my private repository so they can clone it and debug the problem. It's very simple to contact me through this issue and I'll be quick to give access. |
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/hungry-bassi-hzgrzf?file=%2Fpages%2Findex.tsx
To Reproduce
outputFileTracing: false
outputFileTracing: false
innext.config.js
15
seconds6.5
secondsoutputFileTracing: true
outputFileTracing: true
innext.config.js
35
seconds15
secondsCurrent vs. Expected behavior
Currently, it's possible to use
outputFileTracing: false
in yournext.config.js
.Unfortunately, this option is gonna be removed in Next
15.x
, as mentioned when running thebuild
command:This is unacceptable. This option is essential to build fast on Windows, with or without WSL2. I've been running for 2 years with the option disabled without any problem, there is no reason to remove it.
An alternative solution would be to not output at all the file tracing for anyone. Given I spent 2 years without it, I guess it's not an essential part of the build process...
This workaround exists for more than 2 years now. The only reasons I'm opening a new issue is because NextJs is declaring they're gonna remove the workaround soon...
Actually, here's the original issue from 2 years ago and it's still opened: #31021
Please, either fix the issue on Windows or do not deprecate the option. There is no need for a code sandbox here, it's an OS issue.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023 Binaries: Node: 20.11.0 npm: 10.2.4 Yarn: 1.22.21 pnpm: N/A Relevant Packages: next: 14.0.4 eslint-config-next: 14.0.4 react: 18.2.0 react-dom: 18.2.0 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Operating System (Windows, MacOS, Linux)
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
Please see the original issue #31021
The issue has been open since the launch of NextJs
12.x
, 2 years ago...The text was updated successfully, but these errors were encountered: