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.
Reading compile logs
Section titled “Reading compile logs”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 — compilingerror[E0308]: mismatched types --> src/main.rs:42:18 |42 | let x: i32 = "hello"; | ^^^^^^^ expected i32, found &str...[pure] error: JOB_FAILEDThe 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.
Common log patterns
Section titled “Common log patterns”Type errors
Section titled “Type errors”error[E0308]: mismatched typesThis 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.
Missing symbol
Section titled “Missing symbol”error[E0425]: cannot find value `eval` in this scopeYou’re using a feature that is not supported. See Not supported.
Unresolved import
Section titled “Unresolved import”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, thatnode_modulesis included in the tarball orpre_command: "npm ci"is set.
Memory limit exceeded
Section titled “Memory limit exceeded”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.
Isolating the failure
Section titled “Isolating the failure”If the compile error is unclear:
- Reduce the entry point. Comment out imports one by one until the compile succeeds — the last import you removed is likely the cause.
- Use
--emit-rustto see the generated Rust source. This is useful for diagnosing code generation issues. - 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.
Saving logs
Section titled “Saving logs”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.
Reporting a compile failure
Section titled “Reporting a compile failure”See Support for what to include in a bug report.