It seems that npx tsc --noEmit --skipLibCheck --lib es2022 amplify/backend.ts makes it happy.
We should add e2e or integration tests that use expressions used in CDK that surfaced in tests and attempt to compile
We should make compilation step smarter and use tsconfig.json if present.
Example log:
bcd0740fa72c:testapp82 sobkamil$ npx amplify sandbox
[Sandbox] Initializing...
[Sandbox] Executing command `deploy`
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/matcher.ts:201:34 - error TS2802: Type 'IterableIterator<[string, MatchResult]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
201 for (const [key, inner] of x.innerMatchFailures.entries()) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/matcher.ts:248:34 - error TS2802: Type 'Iterable<[boolean, number]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
248 for (const [first, i] of enumFirst(range(r.target.length))) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/matcher.ts:278:36 - error TS2802: Type 'Iterable<[boolean, string]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
278 for (const [first, key] of enumFirst(keys)) {
~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/matcher.ts:309:27 - error TS2802: Type 'Set<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
309 for (const key of remainingFailures) {
~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/matcher.ts:397:19 - error TS2802: Type 'Iterable<A>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
397 for (const x of xs) {
~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/conditions.ts:22:78 - error TS2345: Argument of type 'MatchSuccess | MatchFailure' is not assignable to parameter of type 'MatchFailure'.
Property 'closestResults' is missing in type 'MatchSuccess' but required in type 'MatchFailure'.
22 return formatSectionMatchFailure(`conditions with logicalId ${logicalId}`, result);
~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/section.ts:6:44
6 export type MatchFailure = { match: false, closestResults: Record<string, MatchResult>, analyzed: { [key: string]: any }, analyzedCount: number };
~~~~~~~~~~~~~~
'closestResults' is declared here.
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts:35:26 - error TS2802: Type 'IterableIterator<Set<string>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
35 for (const deps of dependencies.values()) {
~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts:46:8 - error TS2802: Type 'Set<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
46 ...findExpressionDependencies(res.Properties),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts:162:22 - error TS2802: Type 'IterableIterator<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
162 for (const node of deps.keys()) {
~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts:169:23 - error TS2802: Type 'undefined[] | ReadonlySet<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
169 for (const dep of deps.get(node) ?? []) {
~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/mappings.ts:22:76 - error TS2345: Argument of type 'MatchSuccess | MatchFailure' is not assignable to parameter of type 'MatchFailure'.
Type 'MatchSuccess' is not assignable to type 'MatchFailure'.
22 return formatSectionMatchFailure(`mappings with logicalId ${logicalId}`, result);
~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/messages.ts:23:41 - error TS2339: Property 'closestResults' does not exist on type 'MatchSuccess | MatchFailure'.
Property 'closestResults' does not exist on type 'MatchSuccess'.
23 for (const mr of Object.values(result.closestResults)) {
~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/messages.ts:24:21 - error TS2339: Property 'target' does not exist on type 'unknown'.
24 redactTraces(mr.target);
~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/messages.ts:27:73 - error TS2345: Argument of type 'MatchSuccess | MatchFailure' is not assignable to parameter of type 'MatchFailure'.
Type 'MatchSuccess' is not assignable to type 'MatchFailure'.
27 return formatSectionMatchFailure(`messages at path ${constructPath}`, result, 'Stack');
~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/outputs.ts:22:66 - error TS2345: Argument of type 'MatchSuccess | MatchFailure' is not assignable to parameter of type 'MatchFailure'.
Type 'MatchSuccess' is not assignable to type 'MatchFailure'.
22 return formatSectionMatchFailure(`outputs named ${logicalId}`, result);
~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/parameters.ts:22:80 - error TS2345: Argument of type 'MatchSuccess | MatchFailure' is not assignable to parameter of type 'MatchFailure'.
Type 'MatchSuccess' is not assignable to type 'MatchFailure'.
22 return formatSectionMatchFailure(`parameters with logicalId '${logicalId}'`, result);
~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/resources.ts:59:67 - error TS2345: Argument of type 'MatchSuccess | MatchFailure' is not assignable to parameter of type 'MatchFailure'.
Type 'MatchSuccess' is not assignable to type 'MatchFailure'.
59 return formatSectionMatchFailure(`resources with type ${type}`, result);
~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts:1761:49 - error TS2802: Type 'Set<GroupMetric>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
1761 metrics: group._metrics?.size !== 0 ? [...group._metrics].map(m => m.name) : undefined,
~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-config/lib/rule.ts:500:34 - error TS2802: Type 'string' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
500 if (!props.policyText || [...props.policyText].length === 0) {
~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-config/lib/rule.ts:503:14 - error TS2802: Type 'string' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
503 if ( [...props.policyText].length > 10000 ) {
~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts:1648:26 - error TS2802: Type 'Set<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
1648 for (const region of new Set(regions)) { // Remove duplicates
~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts:452:32 - error TS2802: Type 'Set<ApplicationProtocol>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
452 for (const protocol of protocolType) {
~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-iam/lib/role.ts:664:26 - error TS2802: Type 'IterableIterator<PolicyDocument>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
664 for (const newDoc of splitOffDocs.keys()) {
~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts:233:31 - error TS2802: Type 'IterableIterator<[number, CallSite]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
233 for (const [index, site] of sites.entries()) {
~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-s3/lib/bucket.ts:816:28 - error TS2802: Type 'Set<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
816 const keyActions = [...new Set([...perms.KEY_READ_ACTIONS, ...perms.KEY_WRITE_ACTIONS])];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-servicecatalog/lib/portfolio.ts:254:28 - error TS2802: Type 'Set<IBucket>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
254 for (const bucket of this.assetBuckets) {
~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-stepfunctions/lib/state-graph.ts:108:25 - error TS2802: Type 'Set<State>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
108 for (const state of this.allStates) {
~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/aws-stepfunctions/lib/state-graph.ts:148:36 - error TS2802: Type 'Map<string, StateGraph>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
148 for (const [stateId, graph] of this.allContainedStates) {
~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/asset-staging.ts:221:14 - error TS1252: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode.
221 function prependLines(firstLine: string, text: Buffer | string | undefined): string[] {
~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/cloudformation-lang.ts:220:33 - error TS2802: Type 'IterableIterator<[boolean, A]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
220 for (const [comma, item] of sepIter(xs)) {
~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/cloudformation-lang.ts:399:22 - error TS2802: Type 'Iterable<A>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
399 for (const item of xs) {
~~
../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/metadata-resource.ts:117:7 - error TS2802: Type 'IterableIterator<[string, Trie]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
117 [...trie.entries()].forEach(([key, value]) => {
~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/synthesis.ts:119:33 - error TS2802: Type 'IterableIterator<[IPolicyValidationPluginBeta1, string[]]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
119 for (const [plugin, paths] of templatePathsByPlugin.entries()) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/cx-api/lib/toposort.ts:14:25 - error TS2802: Type 'Iterable<T>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
14 for (const element of xs) {
~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/blueprint/step.ts:61:10 - error TS2802: Type 'Set<Step>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
61 ...this._dependencies,
~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/codepipeline/codepipeline.ts:501:29 - error TS2802: Type 'IterableIterator<GraphNode<GraphAnnotation>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
501 for (const stageNode of flatten(structure.graph.sortedChildren())) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/codepipeline/codepipeline.ts:510:35 - error TS2802: Type 'IterableIterator<[number, GraphNode<unknown>[][]]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
510 for (const [i, tranches] of enumerate(chunks)) {
~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/codepipeline/codepipeline.ts:514:54 - error TS2345: Argument of type 'IterableIterator<unknown>' is not assignable to parameter of type 'Iterable<GraphNode<unknown>>'.
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
Type 'IteratorResult<unknown, any>' is not assignable to type 'IteratorResult<GraphNode<unknown>, any>'.
Type 'IteratorYieldResult<unknown>' is not assignable to type 'IteratorResult<GraphNode<unknown>, any>'.
Type 'IteratorYieldResult<unknown>' is not assignable to type 'IteratorYieldResult<GraphNode<unknown>>'.
Type '{}' is missing the following properties from type 'GraphNode<unknown>': dependencies, id, uniqueId, allDeps, and 7 more.
514 const sharedParent = new GraphNodeCollection(flatten(tranches)).commonAncestor();
~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:193:32 - error TS2802: Type 'IterableIterator<[K, DependencyBuilder<A>]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
193 for (const [k, builder] of this.builders.entries()) {
~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:248:17 - error TS2802: Type 'Set<GraphNode<A>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
248 this.add(...other.nodes);
~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:279:29 - error TS2802: Type 'Set<GraphNode<any>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
279 for (const child of node.nodes) {
~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:329:25 - error TS2802: Type 'Set<GraphNode<A>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
329 for (const child of this.nodes) {
~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:354:29 - error TS2802: Type 'Set<GraphNode<any>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
354 for (const child of node.nodes) {
~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:398:24 - error TS2802: Type 'Set<GraphNode<A>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
398 for (const node of this.nodes) {
~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:412:29 - error TS2802: Type 'Set<GraphNode<any>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
412 for (const child of node.nodes) {
~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:429:29 - error TS2802: Type 'Set<GraphNode<any>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
429 for (const child of node.nodes) {
~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:529:22 - error TS2802: Type 'IterableIterator<GraphNode<A>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
529 for (const node of dependencies.keys()) {
~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:540:30 - error TS2802: Type 'IterableIterator<[GraphNode<A>, Set<GraphNode<A>>]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
540 for (const [node, deps] of dependencies.entries()) {
~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.ts:5:25 - error TS2802: Type 'IterableIterator<[GraphNode<A>, Set<GraphNode<A>>]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
5 for (const [k, vs] of dependencies.entries()) {
~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.ts:43:28 - error TS2802: Type 'IterableIterator<Set<GraphNode<A>>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
43 for (const depSet of dependencies.values()) {
~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.ts:58:22 - error TS2802: Type 'IterableIterator<GraphNode<A>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
58 for (const node of deps.keys()) {
~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.ts:65:23 - error TS2802: Type 'undefined[] | Set<GraphNode<A>>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
65 for (const dep of deps.get(node) ?? []) {
~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/legacy/pipeline.ts:419:17 - error TS2802: Type 'IterableIterator<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
419 ret.push(...this.validateDeployOrder());
~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/legacy/pipeline.ts:420:17 - error TS2802: Type 'IterableIterator<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
420 ret.push(...this.validateRequestedOutputs());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/private/javascript.ts:2:19 - error TS2802: Type 'Iterable<A>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
2 for (const x of from) {
~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/private/javascript.ts:14:19 - error TS2802: Type 'Iterable<A>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
14 for (const x of xs) {
~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/private/javascript.ts:15:21 - error TS2802: Type 'Iterable<B>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
15 for (const y of fn(x)) {
~~~~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/private/javascript.ts:23:19 - error TS2802: Type 'Iterable<A>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
23 for (const x of xs) {
~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/private/javascript.ts:34:19 - error TS2802: Type 'Iterable<A[]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
34 for (const x of xs) {
~~
../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/private/toposort.ts:16:25 - error TS2802: Type 'Iterable<T>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
16 for (const element of xs) {
~~
Found 60 errors in 29 files.
Errors Files
5 ../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/matcher.ts:201
1 ../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/conditions.ts:22
4 ../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts:35
1 ../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/mappings.ts:22
3 ../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/messages.ts:23
1 ../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/outputs.ts:22
1 ../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/parameters.ts:22
1 ../../git/aws-cdk/packages/aws-cdk-lib/assertions/lib/private/resources.ts:59
1 ../../git/aws-cdk/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts:1761
2 ../../git/aws-cdk/packages/aws-cdk-lib/aws-config/lib/rule.ts:500
1 ../../git/aws-cdk/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts:1648
1 ../../git/aws-cdk/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts:452
1 ../../git/aws-cdk/packages/aws-cdk-lib/aws-iam/lib/role.ts:664
1 ../../git/aws-cdk/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts:233
1 ../../git/aws-cdk/packages/aws-cdk-lib/aws-s3/lib/bucket.ts:816
1 ../../git/aws-cdk/packages/aws-cdk-lib/aws-servicecatalog/lib/portfolio.ts:254
2 ../../git/aws-cdk/packages/aws-cdk-lib/aws-stepfunctions/lib/state-graph.ts:108
1 ../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/asset-staging.ts:221
2 ../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/cloudformation-lang.ts:220
1 ../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/metadata-resource.ts:117
1 ../../git/aws-cdk/packages/aws-cdk-lib/core/lib/private/synthesis.ts:119
1 ../../git/aws-cdk/packages/aws-cdk-lib/cx-api/lib/toposort.ts:14
1 ../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/blueprint/step.ts:61
3 ../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/codepipeline/codepipeline.ts:501
10 ../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/graph.ts:193
4 ../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.ts:5
2 ../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/legacy/pipeline.ts:419
5 ../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/private/javascript.ts:2
1 ../../git/aws-cdk/packages/aws-cdk-lib/pipelines/lib/private/toposort.ts:16
[Sandbox] Watching for file changes...
Repro steps:
Log below.
Notes:
npx tsc --noEmit --skipLibCheck --lib es2022 amplify/backend.ts
makes it happy.Example log: