## TL;DR
Do not pass `outdir` to the `App` constructor for real runs; it is only for testing. Set the output directory with `cdktf synth -o [dir]`, the `CDKTF_OUTDIR` env var, or the `output` property in `cdktf.json`.

## The error
Setting `outdir` in `AppOptions` (e.g. `new App({ outdir: "my-dir" })`) and running `cdktf synth` raises a synth error instead of writing output to that directory.

## Fix it
1. Remove `outdir` from the `App` constructor in your code; keep `new App()` plain (or with only testing-related options).
2. Pick one of the supported ways to set the output directory:
   - CLI flag: `cdktf synth -o my-dir` (or `--output my-dir`)
   - Environment variable: `export CDKTF_OUTDIR=my-dir`
   - Config file: set `"output": "my-dir"` in `cdktf.json`
3. Re-run `cdktf synth` and confirm output lands in the chosen directory.

Expected result: synth completes and `cdk.tf.json` appears under the configured output directory.

## When to use this
- You set `outdir` in `App`/`AppOptions` and synth errors out
- You want the synth output in a non-default directory

## When NOT to use this
- Synth fails for other reasons (missing provider, bad import) with outdir untouched
- You are writing unit tests for stacks (the in-code outdir is intended for that)

## Root cause
The CDKTF CLI spawns your app as a separate process and there is no channel for the app to tell the CLI which outdir it chose, so the CLI cannot find the generated Terraform config afterward. By design the outdir must come from the CLI side (flag, env var, or cdktf.json). The in-code option exists only so tests can synthesize to a temp directory without a CLI.

## Edge cases
- `cdktf.json` `output` and `CDKTF_OUTDIR` can disagree; the CLI flag wins when several are set.
- Relative outdir paths resolve against the project root, not the stack file location.