-
Notifications
You must be signed in to change notification settings - Fork 59
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
Max app size seems different than reported by Oryx #769
Comments
That is very odd...can you share any details about the name of your app (resource or default hostname) so we can investigate? |
Oh sorry, this is saying the Function content is above 100 MB. The limit above is about the size of the static content for the Static Web App. I believe 100 MB is currently the limit for the Function content. |
Is there a way to have a higher limit for the function app? @prisma/client package alone is over 130MB |
I get this error when trying to deploy a nextjs app, no way is my api folder above 100mb |
@a-haan , I have this error too. It happened around 5 days ago. |
I have the same issue. I don't fully understand which parts are uploaded to a Function and which are the static parts. I emptied my 'api' folder completely but that didn't help. My project really isn't anything complicated, but I guess some packages take a bit of space. I would really like to see the limit raised. |
@a-haan , @microbecode. I have another solution for this case. Use Azure Devops (Pipelines) instead. It worked. |
@ngoctp27 any change you could share your azure-pipelines.yml? I seem to get same error in Pipelines 🤔 |
@valstu I use
|
Same problem here. Not understanding why the 100Mb limit is being shown since the limit should be 250Mb and it always worked until some days ago. |
Hi everyone, this new limitation of 100mb is for the nextjs ssr support we recently released in preview mode. Please check out here for more details. And if you're using static export feature of Nextjs and hitting into this error, please make sure to add |
So after few days of fighting with the 100mb limitation I found out following: Next.js builds are quite large in general, easily over 100mb even with minimal sites. Bundle size is large because of the I changed the build script on As a result my Does anyone have better understanding of Next.js internals and the cache folder? Can we safely remove it or add some config to pipeline which wouldn't upload the cache folder to Azure Functions? At least the build times aren't affected (by removing the cache) since I got Also another option worth investigating is the standalone build of Next.js: At least when making standalone builds it doesn't include I have said this before and say it again but would you consider open sourcing the |
@valstu I tried adding |
Nope, just changed the build command on package json to that. At least it is running it for me Note that |
Ah okay I did not know that. When I build locally and then end up removing the cache folder I am at 85mb so I dont know what's going wrong in the pipeline then :/ |
@valstu How many pages were you generating? I am generating 36 and it is failing. |
Under ten, how big is your .next folder if you build it locally with the new build command? |
@valstu When I build with 13 pages, my .next folder is 180mb. Once I remove the cache folder, the .next folder is 14.5mb. Something is telling me the pipeline isn't calling the rm command :/ This is the build command: This is my pipeline task:
|
Are you using azure pipelines? |
@valstu yes I am |
Ok! I'm using GH Actions so there might be some differences |
Ah that might do it |
We're still stuck on this part. @valstu has added some workarounds; removing Now, we added the file: At the end, it states that But....! After the There it does I see no way to decrease the size of the zip júst before it wants to zip... @vivekjilla maybe you have some hints? |
Been struggling with this for some time as well with pretty small Next.js app - the Next.js build cache and bloated I did bit of investigation, bit of reverse engineering and lot of trial and error - long story short it's possible to (ab)use the In my case this helped (next.js compiler binary under api_build_command: "rm -rf $SOURCE_DIR/node_modules/@next/swc-* && rm -rf $SOURCE_DIR/.next/cache" Now this is executed by the Oryx tool just before the app code is copied to api code folder so we can use it to clean it up a bit. It shouldn't affect the app code, as this was copied to some temporary folder in previous steps and the app zip file is created from that temporary folder. For reference, here is the template that the Oryx tool is using to create the actual build script - the value from This is definitely a hackish solution and worked for me maybe by pure coincidence (small hobby app on free tier, so not a big deal) - your mileage may vary and it's possible this way won't be there forever. For the record, I was trying experimenting also with replacing the full |
This You should switch to Azure This is how should like a
|
@GarryOne While Static Web App was mainly for static content in the past, we're extending support for SSR & server-focused frameworks including NextJS. Support for NextJS SSR is in preview at the moment, and we've blogged about it here: https://techcommunity.microsoft.com/t5/apps-on-azure-blog/extending-next-js-support-in-azure-static-web-apps/ba-p/3627975. We're working on improving support |
Any updates? |
Hey all, |
hey, we have been trying to deploy the SWA but couldn't after trying everything. We didn't have the node_modules folder in the repo so the "build": "next build && rm -rf ./.next/cache", was not working. Then we tried the changes in the next.config.js with the following adding code and it successfully builds the SWA, which worked for us. @thanks Reshmi-Sriram |
Closing this issue, feel free to re-open if necessary! |
worked for me thx |
I have found another fix on stackoverflow to reduce the output size. |
Describe the bug
I got a standard tier for my swa:
A clear and concise description of what the bug is.
Nevertheless deployment fails with the message that my app is over 100MB:
Any reason why this 2 values are different (100MB vs 500MB)?
The text was updated successfully, but these errors were encountered: