Limits

Every limit and rule for anonymous (unclaimed) folds, the error each one produces, and how to fix it.

Claimed deploys, which will lift some of these, are coming soon. Until then every hosted fold is anonymous.

Deploy

LimitValueErrorFix
Artifact size1 MB (1,048,576 bytes)Artifact is <n> bytes, past the 1048576 byte deploy limit.Remove unused code, large strings, and inline assets.
Deploy request size4 MB (artifact plus client bundle)HTTP 413: The deploy is larger than 4 MB.Shrink the client bundle. Do not inline images or data.
Favicon64 KiBArtifact favicon exceeds 65536 bytes.Use a smaller .svg or .ico.
New deploys per addressAbout one per 20 seconds, bursts of 10HTTP 429: Too many new deploys from this address.Wait a few minutes, or redeploy the fold you already have.
Lifetime7 days after the last deployHTTP 410: This fold expired. Deploy it again to bring it back.Redeploy before it expires. Each deploy resets the 7 days.

Redeploying from the same directory keeps the URL and the data. If the fold already expired, deploy creates a new fold instead: a new deploy ID, usually a new URL, and an empty database.

Other deploy errors:

ErrorCauseFix
HTTP 401: This deploy token doesn't match..fold/deploy.json does not match the deploy.Deploy from the directory that created the fold.
HTTP 409: Could not find a free name for this fold.No free subdomain for this name.Change name in fold() and deploy again.
The database could not switch to this schema: ...Existing rows do not fit the new schema.See Schema changes.
This needs a signed-in deploy, which AOZUMI doesn't support yet. (HTTP 501)FOLD_TOKEN is set, or you ran a command that needs an account.Unset FOLD_TOKEN and run npx @aozumi/fold deploy.

Source rules

Anonymous builds scan server/ and shared/ code (comments and strings are ignored) and reject:

Not allowedError starts withFix
fetchOutbound fetch is disabled for anonymous deploys.Remove server-side fetch. Fetch from the browser, or have the other system POST to an endpoint.
while (...) loopswhile loops are not available in anonymous server code.Use for...of over a collection, or a for loop with a fixed bound.
for (;...) loops with no startUnbounded for loops are not availableGive the loop a start and an end.
setTimeout, setIntervalTimers are not available in anonymous server code.Do the work inline.
eval(...)eval is not availableWrite the logic out.
Function(...)Function constructors are not availableUse function or an arrow.
import(...)Dynamic import is not availableUse a static import.
globalThisglobalThis is not availableKeep state in ctx.db.
processprocess is not available in fold codeUse ctx.env (claimed deploys only).
node: importsNode built-ins are not availableUse @aozumi/fold/server.
.where(, .orderBy(, .all(where() is a legacy full-scan database API. and similarUse indexes. See Database.

Promise.all(...) is allowed. Check these rules locally with npx @aozumi/fold build --target anonymous. The dev server does not enforce them.

Also, anywhere in the app:

If fetch is the only problem, or .env.fold.server has values, deploy does not fail. It publishes a placeholder page that says the app needs a claimed deploy. That page is not your app. Remove the server-side fetch and empty .env.fold.server, then deploy again.

Server env

.env.fold.server values are not sent for anonymous deploys, and ctx.env is empty when hosted. Use it only in local dev until claiming is available.

Daily usage

Counters reset at 00:00 UTC.

LimitValueWhat counts
Requests10,000 per dayEvery HTTP request to the app (page loads, client.js, endpoints) and every message a page sends over its WebSocket (query subscriptions, mutations, actions). Sign-in and session checks do not count.
Mutations1,000 per dayEach mutation call, each action call, and each call to a writable endpoint.

Error, as an HTTP 429 or a WebSocket error with a code:

This fold reached its daily request limit (10000). It resets at 00:00 UTC.     code: limit.requests_per_day
This fold reached its daily mutation limit (1000). It resets at 00:00 UTC.     code: limit.mutations_per_day

Fix: batch writes into fewer mutations, avoid calling mutations in loops from the client, and do not subscribe to queries you do not render.

Stored data

LimitValueError
Total stored data1 MBState byte limit exceeded (1048576).
Total rows16,384State row limit exceeded (16384).
One field value64 KiBValue for <table>.<field> exceeds 65536 bytes.

The mutation that would go over the limit fails and none of its writes are kept. Fix: delete old rows, store less per row, or keep summaries instead of raw events.

Per call

LimitValueError
Query, mutation, endpoint run time10 secondsHTTP 504 or call error: Fold <kind> <name> timed out after 10000 ms.
Action run time5 secondsFold action <name> timed out after 5000 ms.
Action arguments16 KiBAction arguments exceed 16384 bytes.
Action result48 KiBAction result exceeds 49152 bytes.
WebSocket message (query or mutation arguments)64 KiBMessages are limited to 65536 bytes.
Endpoint request body2 MiBHTTP 413: Request body exceeds 2097152 bytes.
Writes in flight per page4Too many writes in flight on this connection (max 4). Await earlier writes. The typed client queues for you.
Messages in flight per page32Too many requests in flight on this connection (max 32).

Database budgets per call (rows read 5,000, rows returned 1,000, bytes read 4 MiB, 1,000 get calls, 100 index queries, 1,000 writes) are listed in Database. They throw Database <name> limit exceeded (<limit>).

Not available yet when hosted

These answer 501 with a JSON error saying they are coming soon:

FeatureMessage
File storage (client.storage, /storage)File storage for hosted folds is coming soon.
Logs (npx @aozumi/fold logs <url>)Logs for hosted folds are coming soon.
Database access (db list, db dump, db export)Database access for hosted folds is coming soon.
Inspect (npx @aozumi/fold inspect <url>)Inspecting hosted folds is coming soon.
Access control (users approve and deny)Access control for hosted folds is coming soon.
Claiming, sign-in, tokens, deploy list, archive, restore, terminate, domainsThis needs a signed-in deploy, which AOZUMI doesn't support yet.

ctx.log calls still run when hosted. There is no way to read them yet.