diversable
diversable•6mo ago

Deploying WASM via Deno Deploy Github Actions

Hello, I'm trying to deploy a Leptos project that serves a .wasm bundle for the frontend, and uses wasm on the backend as well. However, I seem to be running into a file size limit for Deno Deploy (or the Deno Deploy github action?). This is the error I'm getting: APIError: The deployment failed: Total static file size is too large: 1409974524 bytes (allowed is 1073741824 bytes) Is there any way of getting around this file size limit? Here's the repo, if that helps.. (I'm trying to deploy using Github Actions) https://github.com/diversable/leptos_hackernews_deno_deploy
GitHub
GitHub - diversable/leptos_hackernews_deno_deploy
Contribute to diversable/leptos_hackernews_deno_deploy development by creating an account on GitHub.
6 Replies
Deno AI Helper
Deno AI Helper•6mo ago
The error message you're encountering indicates that the total size of the static files you're trying to deploy exceeds the 1 gigabyte limit imposed by Deno Deploy. According to the documentation, when uploading assets to a deployment, the total size of all files within the deployment (source files and static files) should not exceed 1 gigabyte. To address this issue, you have a few options: 1. Optimize Your Assets: Try to reduce the size of your .wasm files and any other assets you're deploying. This could involve using tools to minimize and compress your files or splitting larger modules into smaller ones if possible. 2. External Hosting: If optimization isn't enough, consider hosting larger assets on a separate service and loading them from your Deno Deploy application via URLs. This way, you can bypass the file size limit for the deployment itself. 3. Contact Deno Support: If you have a use case that exceeds the file size limits and you believe it's justified, the documentation suggests reaching out to Deno support. They may be able to provide further assistance or discuss potential options for your specific scenario. Unfortunately, there isn't a direct way to bypass the file size limit through configuration or settings in Deno Deploy or GitHub Actions. The limit is enforced to ensure fair use of resources on the platform. Here's a snippet from the documentation regarding the maximum size for deployments:
## Maximum size for deployments​

When uploading assets to a deployment, the total size of all files within the
deployment (source files and static files) should not exceed 1 gigabyte.
## Maximum size for deployments​

When uploading assets to a deployment, the total size of all files within the
deployment (source files and static files) should not exceed 1 gigabyte.
For your current situation, you'll need to consider one of the above strategies to bring your deployment within the allowed limits. 🦕
diversable
diversable•6mo ago
Any humans out there who can help with this issue?
fyrfnn
fyrfnn•6mo ago
i think you can host the wasm file on github pages or try to minimize the build size first (usually will affect the performance) ok so ive read your code and youre trying to use wasm as your server i dont think i can help you with that another way (but painfully slow) is write a compression and decompression algorithm basically push the compressed file and decompress it when running the server
diversable
diversable•6mo ago
yeah, this is an app that's built using the fullstack Rust framework Leptos (see https://leptos.dev) I'm trying to set up a template for all Leptos devs to use in the future (I'm writing/updating the Leptos book) - so yeah, we're gonna need to up the standard deployment size for that to work. Do you know who I'd need to talk to make this happen?
fyrfnn
fyrfnn•6mo ago
maybe talk to one of the core members? im sure they can sort this out
diversable
diversable•6mo ago
good to know - thank you very much for your help!! Happy Holidays!