Build Error (BUILD_ERROR)
- Applies to
- Gatewayruntime for API, AI, and MCP gateways
- Hosting
- Managed EdgeManaged DedicatedSelf-Hosted
There was an error building your project. The gateway returns this error when the project fails to compile during deployment.
Common causes
- TypeScript errors - Type mismatches, missing type definitions, or invalid TypeScript syntax prevent the project from compiling.
- Missing imports - A module or package referenced in the code is not installed or does not exist.
- Invalid route configuration - The
routes.oas.jsonfile contains syntax errors or references policies or handlers that do not exist. - Missing export - A policy or route handler refers to an export that its module doesn't contain. See Missing export.
- Schema errors in
policies.jsonand routes - A value inconfig/policies.jsonor in a route'sx-zuplo-routedoesn't match the expected format. See Schema errors in policies.json and routes. - Incompatible dependencies - A package dependency has version conflicts or is not compatible with the Zuplo runtime.
Missing export
If the export of a policy in config/policies.json, or of a route handler,
isn't in the module that module names, the build fails. The error names the
export, the module, and the policy:
Code
To fix it:
- Check the spelling and capitalization of
export. When a similar name exists in the module, the error suggests it (Did you mean 'MyPolicy'?). - If the export lives in a different entry point of the same package, the error
names it. Change
moduleto that entry point. For example, policies for the MCP Gateway come from$import(@zuplo/runtime/mcp-gateway), not from$import(@zuplo/runtime). - For a custom module, make sure the file exports the name and compiles without errors.
A policy that no route uses only produces a warning, because nothing calls it yet. The build fails as soon as a route uses that policy.
Schema errors in policies.json and routes
The build validates config/policies.json and the x-zuplo-route of every
route in your OpenAPI files. Each error names the file and the
JSON pointer of the invalid
value, and quotes the value when it's short:
Code
Code
Use the pointer to find the value. In the first example, /policies/0/name is
the name of the first entry in policies. Fix the value so that it matches
the format the message describes.
$env() is only
allowed in some locations. Using it in a policy name, for example, produces a
schema error like the first one above.
How to access build logs
- Open the Zuplo portal and navigate to the project.
- Check the deployment logs for detailed error messages and stack traces.
- For local development, run the build locally to see the full error output.
How to fix
- Read the error message carefully. Build errors typically include the file name, line number, and a description of the issue.
- Fix any TypeScript compilation errors by checking types and imports.
- Verify that all referenced modules are listed in
package.jsonand properly installed. - Validate the
routes.oas.jsonfile to ensure all handler and policy references are correct.
Run builds locally before deploying to catch errors early. See Local Development for setup instructions.