[create-next-app, Yarn, linux/Darwin] Fresh Next projects can't be pushed to GitHub due to size of tracked @next/swc binary #65586
Labels
bug
Issue was opened via the bug report template.
create-next-app
Related to our CLI tool for quickly starting a new Next.js application.
Link to the code that reproduces this issue
https://github.com/bosconian-dynamics/cna-repro-yarn-pnp-gh
Note: the issue is itself the inability to push repos which create-next-app produces to GitHub, and as such it prevents me from creating a minimal reproduction repository. The repo above is a dummy to satisfy the issue template requirements.
To Reproduce
In a WSL2 Ubuntu x64 environment (or likely other linux/unix environments):
yarn create next-app foobar
cd foobar
git remote add origin https://github.com/xxx/foobar
git push origin main
Current vs. Expected behavior
Observation
In linux/unix environments (or at the very least in WSL2 Ubuntu 20 x64, and evidently Darwin x64), Yarn PnP in combination with create-next-app's templates'
.gitignore
files result in create-next-app creating project repositories with an initial commit which cannot be pushed to free GitHub repositories due to the 100M file size limitation. The large file in question appears to be the Next compiler which resides at the following location in my Next repositories:In my environment, the
git push
operation produces the following output:Resolving the issue necessitates a fair bit of research on the end-user's part, and ultimately the modification of the default
.gitignore
file provided by the templates as well as squashing or rewriting the repo's history to exclude the problematic files. Alternately - if users instead follow the advice suggested by thegit
error - they may end up down a different rabbit hole, setting up Git LFS (and likely engaging GitHub's LFS services which may incur costs in short order) just to handle the SWC binary.The issue is compounded in downstream tools such as Cloudflare's
create-cloudflare
, which themselves may create additional commits on top of the one which create-next-app makes, further cementing the problematic file's inclusion in the fresh project repository's history.Expectation
Project repositories created via create-next-app should be able to be pushed to a free GitHub repository immediately, without requiring the end-user to modify default files and squashing/rewriting repository history or set up Git LFS.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Wed Mar 2 00:30:59 UTC 2022 Binaries: Node: 20.11.1 npm: 10.2.4 Yarn: 4.2.2 pnpm: N/A Relevant Packages: next: 14.1.0 eslint-config-next: 14.1.0 react: 18.3.1 react-dom: 18.3.1 typescript: 5.4.5 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
create-next-app
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
This issue has been discussed within the context of Darwin in April of 2023 - and other unknown environments in the time since - see #48956
The text was updated successfully, but these errors were encountered: