Skip to content

Compile Failures

When a compilation fails, the server sends compile.error with code JOB_FAILED. The details are in the compile.log messages that arrived during the job. This page explains how to read those logs and narrow down the cause.

Compile logs are streamed as compile.log messages while the job runs. Each message has a line field with one line of output.

With the CLI, log lines are printed to stdout in real time:

[pure] queued (position 1)
[pure] started — compiling
error[E0308]: mismatched types
--> src/main.rs:42:18
|
42 | let x: i32 = "hello";
| ^^^^^^^ expected i32, found &str
...
[pure] error: JOB_FAILED

The log output is from the Rust compiler. You do not need to understand Rust to interpret most errors — they map back to your TypeScript/JavaScript source.

error[E0308]: mismatched types

This usually means your TypeScript code is using a value in a way Pure’s code generator doesn’t support statically. Check the line reference and simplify the expression.

error[E0425]: cannot find value `eval` in this scope

You’re using a feature that is not supported. See Not supported.

error: failed to resolve import './missing.js'

An import cannot be found. Check:

  • The file exists in the tarball.
  • The path is spelled correctly (case-sensitive on Linux).
  • If the file is in node_modules, that node_modules is included in the tarball or pre_command: "npm ci" is set.
Killed (signal 9)

The job was killed by the out-of-memory killer. Your dependency tree may be too large. Try:

  • Excluding dev dependencies from the tarball.
  • Using a lighter alternative package.
  • Contacting support to request a higher memory limit.

If the compile error is unclear:

  1. Reduce the entry point. Comment out imports one by one until the compile succeeds — the last import you removed is likely the cause.
  2. Use --emit-rust to see the generated Rust source. This is useful for diagnosing code generation issues.
  3. Check the package. If the error points to a package in node_modules, check if that package is in the known issues list or the issue tracker.

The CLI saves compile logs to ./pure_out_<name>/compile.log on failure. Include this file when reporting a bug.

Logs are also available in the dashboard under the job’s detail view for 30 days after the job runs.

See Support for what to include in a bug report.