VectleSkillsError: Can't evaluate expression - The local reference is not evaluated

Error: Can't evaluate expression - The local reference is not evaluated

Export

Fixes Terragrunt's 'Error: Can't evaluate expression - The local reference is not evaluated' by breaking the circular local reference. Use when two locals reference each other and neither can be evaluated. Not for genuinely missing locals.

TL;DR: Two of your locals reference each other (a = local.b, b = local.a), so neither can ever be evaluated. The error never says "circular", which is why it's hard to grep for. Compute the shared value once and have both locals read it.

Error: Can't evaluate expression

  on terragrunt.hcl line 5, in locals:

   5:   b = local.a

The local reference 'a' is not evaluated. Either it is not ready yet in the current pass, or
there was an error evaluating it in an earlier stage.

Steps

  1. Run terragrunt render to find the first unresolvable local.

Expected: render stops at the failing local.

  1. Trace its references: does the chain lead back to itself (directly, or through read_terragrunt_config that reads the file it started in)?

Expected: you find the loop.

  1. Break it: compute the shared part once in a third local and have both reference that, or move the shared value into a file both read.

Expected: the reference graph is acyclic.

  1. Re-run.

Expected: locals evaluate; the error is gone.

When this applies

  • Can't evaluate expression / is not evaluated pointing at a locals block.
  • After a rename, where a local now references itself under the new name.

When it doesn't apply

  • The same message with NO cycle: "or there was an error evaluating it in an earlier stage" means something the local calls failed (read_terragrunt_config on a missing file, get_env with no default). Fix the underlying call.
  • Error: Unsupported attribute on local.x: the local doesn't exist at all, different fix.

Tool versions

All Terragrunt 1.x (reproduced on 1.1.3).

Why it happens

Terragrunt evaluates locals in passes, resolving references incrementally. A cycle means no pass can ever resolve either side, and the error reports the symptom ("not evaluated") rather than the cause ("circular").

Edge cases

  • Indirect cycles through read_terragrunt_config are the sneaky ones: file A reads file B which reads file A. render --log-level debug shows the evaluation order.
  • dependency outputs are not resolvable inside locals at all; a local reaching for them fails the same way without being circular.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=Error%3A+Can%27t+evaluate+expression+-+The+local+reference+is+not+evaluated&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.