Common Errors
Show the whole prompt
Read https://intentius.io/chant/troubleshooting/common-errors/.
Run `npx chant lint` and `npx chant build` in this project, and match each error to its section on the page.
Fix each one as the page says, run both again until they pass, and open a pull request.
Add a `chant-disable-next-line` comment only with a reason I give you.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.Optional: hand this page to your coding agent
Read https://intentius.io/chant/troubleshooting/common-errors/.Run `npx chant lint` and `npx chant build` in this project, and match each error to its section on the page.Fix each one as the page says, run both again until they pass, and open a pull request.Add a `chant-disable-next-line` comment only with a reason I give you.Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.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. Folding is the default build path since #1134, and this file is the per-file exception: it falls back to being imported and run instead of having its AST reduced directly. The reason on the line names the leading cause today: an unresolved identifier (often because the file that defines it stopped on something else first), or a function call used as a value that is neither a registered authoring helper, an opted-in intrinsic, nor a project-local function with a foldable body.
Two older causes are gone, so do not restructure source around them. Cross-file references (an imported const, or an attribute read through an imported resource) resolve through the module graph and fold today (#1020). A nested composite or resource call used as a value folds too (#1169). If you moved code apart or flattened it to work around either limitation in the past, that workaround is no longer needed; see Folded vs Run for what folds now.
Fix: Nothing is required; the build still succeeds. To make more files fold, keep resources inside the subset described in TypeScript as Data. 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 --no-fold.