Open AnasArafeh opened 10 months ago
maybe duplicate of #57886
probably fixed by https://github.com/vercel/next.js/pull/57904
@jantimon @abenhamdine I have tried the latest canary release Next 14.0.2-canary.21 that I believe includes the fix mentioned.
There was a small decrease few kb as shown in screenshot
Next 14.0.2-canary.12
Next 14.0.2-canary.21
However, if you compare it to Next 13.5.6 ( screenshot available in the issue above ) you can see that the actual First Load JS size is doubled for some files, so these few KB changes does not resolve the issue.
Thanks for reporting! After having a closer look, this seems to be related to a regression via https://github.com/vercel/next.js/pull/57474/files#diff-e249217c618857db05acc1cba9dbaad4e488dbb256aa0b33ea471e9ff1629c33
we will have a look!
Here are some stats from a real world project:
The overall bundle size is increasing by about 13kb (before gzip) but that's only a fraction of the overall project size
Link to the code that reproduces this issue
https://github.com/AnasArafeh/Next14-build-issue-reproduction
To Reproduce
Current vs. Expected behavior
Following the previous steps:
The result for npm run build in Next 13.5.6 :![13 5 6](https://github.com/vercel/next.js/assets/68680829/9d202811-fb67-41c5-857c-61cb401a4b72)
And the result for npm run build in Next 14.0.1 :![14 0 1](https://github.com/vercel/next.js/assets/68680829/fc054067-1184-4313-88b1-a4e3bc46f410)
the only package changes were these using git :![git-changes](https://github.com/vercel/next.js/assets/68680829/f1b4804f-83a2-4ca5-b74b-25db9adf03f5)
The result for Next 14.0.2-canary.12 :![14 0 2-canary 12](https://github.com/vercel/next.js/assets/68680829/751106af-9654-4e94-ae4d-dbf0c17d9ce4)
Screenshots from reproduction template
Next 13.5.6
Next 14.0.2-canary.12
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Package manager (npm, pnpm, Yarn), Script optimization (next/script)
Additional context
The issue was introduced in Next 14, I have also tested it on the latest canary release and the issue remains the same. I have even noticed 1 KB increase in canary release compared to Next 14.0.1.
NEXT-1762