Common Errors
EVL001: Expression Not Statically Evaluable
Section titled “EVL001: Expression Not Statically Evaluable”A resource property contains a function call, method call, or other dynamic expression.
src/bucket.ts:5:3 error [EVL001] expression in property "name" is not statically evaluableFix: Replace dynamic expressions with literal values or const references.
EVL002: Resource Inside Control Flow
Section titled “EVL002: Resource Inside Control Flow”A resource declaration is wrapped in if, for, while, switch, or try.
Fix: Move the resource to the top level. Use separate files for different environments.
EVL003–EVL004
Section titled “EVL003–EVL004”See Evaluability Rules for details on dynamic property access and non-const spread sources.
EVL005: Block Body in resource() Callback
Section titled “EVL005: Block Body in resource() Callback”Fix: Use an expression body: (props) => ({ ... }).
COR011: Circular Dependency
Section titled “COR011: Circular Dependency”Fix: Restructure imports to break the cycle by extracting shared types into a separate file.
COR003: String Literal Where Resource Reference Expected
Section titled “COR003: String Literal Where Resource Reference Expected”A property expects a reference to another resource but received a plain string.
src/api.ts:8:5 error [COR003] property "role" expects a resource reference, got string literalFix: Import the referenced resource and use its output attribute (e.g., myRole.arn) instead of a hard-coded string.
COR004: Unused Declarable Export
Section titled “COR004: Unused Declarable Export”An exported resource is not referenced by any other resource or output.
src/logging.ts:3:14 warning [COR004] exported declarable "logBucket" is unusedFix: If intentional, suppress with // chant-disable-next-line COR004. Otherwise, remove the unused export or wire it into your stack.
COR007: Missing Required Property
Section titled “COR007: Missing Required Property”A resource is missing a property that the lexicon marks as required.
src/queue.ts:4:14 error [COR007] resource "myQueue" is missing required property "queueName"Fix: Add the missing property to your resource definition.
COR008: Unknown Property Name
Section titled “COR008: Unknown Property Name”A resource contains a property name not recognized by the lexicon.
src/bucket.ts:6:5 error [COR008] unknown property "bucketNmae" on resource type BucketFix: Check for typos. Use editor autocompletion from the lexicon types to find the correct property name.
COR010: Unused Export (No Consumers)
Section titled “COR010: Unused Export (No Consumers)”An exported const value is never imported by any other file in the project.
src/defaults.ts:2:14 warning [COR010] export "legacyTags" has no consumersFix: Remove the unused export, or suppress with // chant-disable-next-line COR010 if it’s intentionally kept for future use.
Unknown Resource Type
Section titled “Unknown Resource Type”The resource class isn’t recognized by the installed lexicon.
Fix: Check for typos, then update the lexicon (npm update) and run chant update to sync lexicon types.
[fold:run] <file> — <reason> (using chant build --verbose)
Section titled “[fold:run] <file> — <reason> (using chant build --verbose)”Symptom: chant build reports fold: N files folded, M ran, and chant build --verbose logs [fold:run] for a file you expected to fold.
Cause: This isn’t an error — the file simply falls back to the normal run path for this build, exactly as if --fold hadn’t been passed. The reason on the line says why: a construct outside the fold subset (a re-export, export default, a nested composite/resource call used as a value), or — the most common cause — a reference to another file’s export, which cross-file resolution doesn’t support yet (#1020).
Fix: Nothing is required; the build still succeeds. To make more files fold, keep resources inside the subset described in TypeScript as Data and avoid cross-file references in files you want to fold. Compare fold vs. run output for your whole project with just fold-differential (in the chant repo) or by diffing chant build against chant build --fold.