-
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
The content server has rejected the request with: BadRequest 147 Reason: The size of the function content was too large. The limit for this static site is 31457280 bytes. #214
Comments
Hello. I have the exact same error. Only I am brand new at this and I am only trying to run the tutorial from the static web apps documentation. My app is supper small. It has no content is just 'hello world'. But I don't know what to do to resolve. Attached an image of the error. Experience tells me if we both have the same error and it is very first in the list then maybe a new bug was just introduced. Or maybe we both need to set some configuration somewhere. I have looked around but I don't know what. |
@jrathgeber Your app does not have an API, however, the workflow is configured with an API location, which caused the GitHub action to treat your entire app as an Azure Function app and try to deploy it, and it is hitting the API app limit of 30MB. Please change that valve to an empty string and see if that solves the issue. |
It works now. Thank you very much. |
@myaesubi Can you let me know if you're still experiencing this problem and if you have more information that you can share about your app, especially the workflow file? Thanks. |
Hi @anthonychu I think the quota for Blazor apps should be increased, since they are sitting on the .NET side with .dll files, comparing to Angular JS or other Javascript frameworks. Thanks, |
Just to clarify, our limit for the frontend apps for the current free offering is 250MB. That should be plenty for your Blazor app. You are hitting the limit on the function app, which is currently at 30MB. We plan on increasing this. If you believe your Blazor app is blocked by the 30MB limit, please share more information and we can help troubleshoot. |
Hi Anthony, Here is the link: What I had to do is workaround is to put the a message to a message queue to be picked up by my pay-as-you-go Function Apps (consumption plan) and generate Pdf with that app service in meantime. I really wish to have the function app self sufficient for generating the PDF file and eliminate the queue and queue trigger in my app service function app. Thanks, |
Yep. We will be increasing it soon. Thanks for your patience. /cc @annaji-msft |
@jrathgeber Do you mind sharing which tutorial you were following? We want to make some updates to make it more clear that the API location should be left empty. Thanks! |
Good morning. I had a look at my history and this what I found. It was 2 weeks ago now. |
Thanks @jrathgeber! Just tried it and you are correct that the link (https://github.com/staticwebdev/react-basic/generate) is broken if you are not logged into GitHub. We will update the instructions in the quickstarts and tutorials so it works well whether you are logged in or not. /cc @craigshoemaker @johnpapa |
Hi @anthonychu,
@anthonychu could you be able to advise a tentative timeline please. Thanks. |
Setting api_location to empty string resolves the issue for me, thanks for the excellent answer. |
Closing as bring your own functions serves as a workaround to this. |
I'd like to reopen this thread. I am running into the same issue. I am running into the size limit whilst I only have one function in my api folder. It is a python function and I have about 100 lines of code and I import When I zip the api folder myself it ends up being 18MB. @anthonychu do you perhaps have a suggestion? |
Also running into this with the new NextJS Hybrid deployment. I added Prisma to the project and it immediately started throwing this error. |
Me too facing the same issue on NextJs deployment, the task I'm using is as follows: - deployment: 'DeployStaticwebapp'
dependsOn: ['Build']
environment: $(DevopsEnvironment)
strategy:
runOnce:
deploy:
steps:
- checkout: 'self'
- task: AzureStaticWebApp@0
inputs:
app_location: '/'
output_location: 'build'
azure_static_web_apps_api_token: $(deployment_token)
app_build_command: npm run build Note there is no reference to api_location. |
Bump, having the same problem. Also without I did deviate from the tutorial in the docs in so far, that i did not include ‘next export‘. That can currently not run when internationalized routing is enabled. @miwebst Should we open a separate ticket for this since this one has already been closed? |
For NextJS Hybrid apps,
|
Same problem with NextJS hybrid here as well. I have tried to follow your suggestions @vivekjilla, but it doesn't solve the issue. The devops task is building both app and api, even though the api_location is empty string. The documentation is obviously also not good enough. Please fix this as soon as possible. If not able to fix it, please consider increasing the max size. Looking forward to your swift response. |
We are facing the same problem with NextJS. Our .next folder after the build is under 2.5MB. |
@saicoder @gzSupertramp if We're working on improving this experience, but unfortunately we're not aware of any workaround as of today. Apologies for the inconvenience. |
Thanks @vivekjilla. No, it's a plain Next.js app with only chakra-UI as a dependency. My The only way currently is to export the Next.JS app as a static website without SSR. |
@saicoder Can you please try moving the TypeScript to devDependencies in the package.json and see if it helps. |
I've moved most of the dependencies to dev dependencies, and it did the trick. Thanks @vivekjilla Just one side note, it would be useful that build log shows the final zip size. |
We were finally able to solve this as well in the following way:
This way, Oryx seems to find the standalone folder for the app on its own, being able to create the function app. A permanent fix and better DevEx is definitely needed here anyways. |
I have a static web app built with nextjs that doesn't use getStaticProps/getStaticPaths, neither SSR. It's a Redux RTK query base app that has some dynamic API calls in some pages that I use to populate form fields and submit them.
So, after an entire morning spent looking for a solution I was able to overcome the problem by:
Hope this helps someone 👋🏻 |
Confirming that this is still an issue. Removing the cache is the only thing that works. I have no idea why Oryx even attempts to perform api bundling when I have no api folder listed in the yaml. I would say that's a certified bug, since it should be willing and able to ship anything under the 250mb/500mb limit specified by the hosting plan. |
Im having this issue too and i couldn't find a fix . my api route in empty too |
Saved my day. |
Having the same isse: #1034 (comment) Why is this topic closed? |
Deployment Issue: Function Content Size Error on Azure Static Web App Hi everyone, I’m currently facing a deployment issue with my Azure Static Web App. The application was working perfectly fine until I added one more page. Now, I’m encountering the following error during deployment:
Here are the details of what I’ve tried so far: Verified that the maximum size limit on Azure is set to 500MB, so it shouldn’t be a size issue.
The issue has broken my production environment, and I’d really appreciate it if someone could help me resolve this. Thank you in advance! package.json: {
"name": "rewriterpro_nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@emailjs/browser": "^3.11.0",
"@headlessui/react": "^0.0.0-insiders.043edb8",
"@heroicons/react": "^2.0.18",
"@next/third-parties": "^14.1.3",
"@react-oauth/google": "^0.12.1",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.9",
"@types/jest": "^27.5.2",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"axios": "^1.6.7",
"chatgpt": "^5.2.5",
"crypto-browserify": "^3.12.0",
"firebase": "^10.6.0",
"next": "^14.1.1",
"nextjs-toploader": "^1.6.12",
"nprogress": "^0.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-firebase-hooks": "^5.1.1",
"react-google-button": "^0.7.2",
"react-minimal-pie-chart": "^8.4.0",
"react-social-login-buttons": "^3.9.1",
"rewriterpro_nextjs": "file:",
"stream-browserify": "^3.0.0",
"stripe": "^12.10.0",
"txtgen": "^3.0.6",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8.57.0",
"eslint-config-next": "14.1.1",
"eslint-config-prettier": "^9.1.0",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
} next config /** @type {import('next').NextConfig} */
const nextConfig = {
};
export default nextConfig; name: Azure Static Web Apps CI/CD
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: false
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_BUSH_0AF2C3D10 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: ".next" # Built app content directory - optional
app_build_command: 'yarn run build'
api_build_command: 'rm -rf ./node_modules/@next/swc-* && rm -rf ./.next/cache'
env: # Put a node version on the following line
NODE_VERSION: 20
NEXT_PUBLIC_GOOGLE_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_GOOGLE_CLIENT_ID }}
NEXT_PUBLIC_GOOGLE_CLIENT_SECRET: ${{ secrets.NEXT_PUBLIC_GOOGLE_CLIENT_SECRET}}
NEXT_PUBLIC_OPEN_AI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPEN_AI_API_KEY}}
NEXT_PUBLIC_WEBSITE_HTTPLOGGING_RETENTION_DAYS: ${{ secrets.NEXT_PUBLIC_WEBSITE_HTTPLOGGING_RETENTION_DAYS}}
NEXT_PUBLIC_PRODUCT_ID: ${{ secrets.NEXT_PUBLIC_PRODUCT_ID}}
NEXT_PUBLIC_ENV: ${{ secrets.NEXT_PUBLIC_ENV}}
NEXT_PUBLIC_ATLAS_DATA_API_KEY: ${{ secrets.NEXT_PUBLIC_ATLAS_DATA_API_KEY }}
NEXT_PUBLIC_EMAILJS_SERVICE_ID: ${{ secrets.NEXT_PUBLIC_EMAILJS_SERVICE_ID }}
NEXT_PUBLIC_EMAILJS_TEMPLATE_ID: ${{ secrets.NEXT_PUBLIC_EMAILJS_TEMPLATE_ID }}
NEXT_PUBLIC_EMAILJS_TEMPLATE_ID_CONTACT_FORM: ${{ secrets.NEXT_PUBLIC_EMAILJS_TEMPLATE_ID_CONTACT_FORM }}
NEXT_PUBLIC_EMAILJS_PUBLIC_KEY: ${{ secrets.NEXT_PUBLIC_EMAILJS_PUBLIC_KEY }}
NEXT_PUBLIC_STRIPE_SECRET_KEY_PROD: ${{ secrets.NEXT_PUBLIC_STRIPE_SECRET_KEY_PROD }}
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
app_location: "/"
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_BUSH_0AF2C3D10 }}
action: "close"
|
Hi @anthonychu/@annaji-msft,
I am developing the static website that I'm building is based on the Blazor framework.
I have NuGet library that is the bits around 30Mb should be part of the "Api" part. The CI/CD fails with the following error.
The content server has rejected the request with: BadRequest 147 Reason: The size of the function content was too large. The limit for this static site is 31457280 bytes.
Is there any way to fix this, increase the space. any urgency this be done much appreciated.
Thanks in advance,
Mohammad
The text was updated successfully, but these errors were encountered: