Skip to content
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

Static web app API size of the function content was too large #1004

Open
audriusl opened this issue Nov 30, 2022 · 8 comments
Open

Static web app API size of the function content was too large #1004

audriusl opened this issue Nov 30, 2022 · 8 comments

Comments

@audriusl
Copy link

Describe the bug

2 weeks ago the build went through without a problem . Now I updated frontend part and I'm getting function content was too large. It is strange that it happened without any changes to code.
There some problem with the build when i compare with the successful one - Error TS1192: Module '"/github/workspace/api/node_modules/@prisma/client/runtime/index"' has no default export.

2022-11-30T09:21:57.1601556Z �[37mnode_modules/.prisma/client/index.d.ts(3,8): error TS1192: Module '"/github/workspace/api/node_modules/@prisma/client/runtime/index"' has no default export.�[0m
2022-11-30T09:21:58.4439556Z �[37m�[0m
2022-11-30T09:21:58.4440122Z �[37m�[0m
2022-11-30T09:21:58.4440617Z �[37m---End of Oryx build logs---�[0m
2022-11-30T09:21:58.4543628Z �[33mOryx was unable to determine the build steps. Continuing assuming the assets in this folder are already built. If this is an unexpected behavior please contact support.�[0m
2022-11-30T09:21:58.4544517Z �[33mFunction Runtime Information. OS: linux, Functions Runtime: ~4, node version: 16�[0m
2022-11-30T09:21:58.4545126Z �[37mFinished building function app with Oryx�[0m
2022-11-30T09:21:59.3718421Z �[37mZipping Api Artifacts�[0m
2022-11-30T09:22:18.8732640Z �[37mDone Zipping Api Artifacts�[0m
2022-11-30T09:22:19.2410808Z �[31mThe content server has rejected the request with: BadRequest�[0m
2022-11-30T09:22:19.2411621Z �[31mReason: The size of the function content was too large. The limit for this Static Web App is 104857600 bytes.�[0m
2022-11-30T09:22:19.3751045Z �[37m�[0m

@dtulltgna
Copy link

Getting the same error on ours, however, this is a new app for us, so cannot verify any previous working condition.
---End of Oryx build logs---
220
Function Runtime Information. OS: linux, Functions Runtime: ~4, node version: 16
221
Finished building function app with Oryx
222
Zipping Api Artifacts
223
Done Zipping Api Artifacts
224
The content server has rejected the request with: BadRequest
225
Reason: The size of the function content was too large. The limit for this Static Web App is 104857600 bytes.
226

@annikel
Copy link

annikel commented Dec 6, 2022

@audriusl @dtulltgna would you mind sharing more details about your site like your default hostname or the deployment ID. Feel free to create a support ticket if you do not want to share this information here.

@audriusl
Copy link
Author

audriusl commented Dec 30, 2022

Hi,
I moved to cloud functions, I think it is api size limit, because I'm using prisma.

@patrik-simunic-cz
Copy link

patrik-simunic-cz commented Jan 1, 2023

Yeah, this is a problem on MS side. In case anyone needs a workaround (before it's fixed), see this issue, particularly this answer: #214 (comment)
(Basically, strip the final artifact, including node_modules/ if included, as much as possible - below 100Mb)

@pietz
Copy link

pietz commented Jan 19, 2023

can the problem be fixed by purchasing the non free SWA tier and/or putting the API in its own app?

@audriusl
Copy link
Author

I put my API on azure cloud functions and start using SWA only for static web site.

@suyash-more
Copy link

suyash-more commented Mar 23, 2023

image

- task: AzureStaticWebApp@0
      displayName: "Development Build and Deploy"
      condition: eq(variables['Build.SourceBranchName'], 'development')
      inputs:
        app_location: "./"
        api_location: ""
        output_location: "build"
        app_build_command: 'npm run build'
        api_build_command: 'rm -rf ./node_modules/@next/swc-* && rm -rf ./.next/cache'
      env:
        azure_static_web_apps_api_token: $(deployment-token-dev)

This is my configuration for the static app which is built in nextJS. I tried removing the cache but as the modules are expanding the size does not remain below 100 MB. I need a solution to this.
These configs will work for apps below 100MB but not above.
Can this be solved or is there any other solution ?
image

@NortonS1
Copy link

NortonS1 commented Sep 8, 2023

Having exactly the same issue. Using all the solutions on here and the other linked issue worked... Until I added an azure sql database connection - adding the api associated with that pushes the function content over the top and now I'm back to this error. Any updates on solutions? I can't find any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants