I also get this output I can't figure out why: ```...
# help
I also get this output I can't figure out why:
Copy code
stacks/AuthStack.js (58,23): Object is possibly 'undefined'.
56.       UserPoolId: auth.userPoolId,
57.       IdentityPoolId: auth.cdk.cfnIdentityPool.ref,
58.       UserPoolClientId: auth.cdk.userPoolClient.userPoolClientId,
I tried to migrate this with the migration guide, which told me to move cognitoCfnIdentityPool ⇒ cdk.cfnIdentityPool
You can't see it in my snippet above, but it's highlighting line 57 as problematic
Depends on your usecase for it, i was just outputting it so did the following 😅
Copy code
      Region: scope.region,
      UserPoolId: this.auth.cdk.userPool.userPoolId,
      IdentityPoolId: this.auth.cdk.cfnIdentityPool?.ref || '',
      UserPoolClientId: this.auth.cdk.userPoolClient.userPoolClientId,
Yeah, suppressing the output with your approach works great, but it turns out that it's not actually empty at all anyway
I guess the warning is because the framework can't really decide at that point if it's going to be empty or not
Thanks @Noah D!
Hey @Adrian Schweizer for JS code, we actually run a “type check” on build to warn about mismatched types (like in TypeScript).
When u call addOutputs, it’s expected that the output value needs to be a string, but
could be undefined, so the type check complained.
That said, I think @thdxr might’ve relaxed the type checking rule to not complain about this case. @thdxr can you confirm?