Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Type 'App' is missing the following properties #8

Open
rfc2119 opened this issue Jun 24, 2022 · 1 comment
Open

Error: Type 'App' is missing the following properties #8

rfc2119 opened this issue Jun 24, 2022 · 1 comment

Comments

@rfc2119
Copy link

rfc2119 commented Jun 24, 2022

Hi,

I have tried using this with latest CDK (version 2.29.0 (build 47d7ec4)) and Node 18.4 and I am always getting this error one way or the other:

/root/cdk-debug-evbridge/node_modules/ts-node/src/index.ts:843                                                              
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);                                                       
           ^                                                                                                                
TSError: ⨯ Unable to compile TypeScript:                                                                                    
bin/cdk-debug-evbridge.ts:7:27 - error TS2345: Argument of type 'import("/root/cdk-debug-evbridge/node_modules/aws-cdk-lib/c
ore/lib/app").App' is not assignable to parameter of type 'import("/root/cdk-debug-evbridge/node_modules/@aws-cdk/core/lib/a
pp").App'.                                                                                                                  
  Type 'App' is missing the following properties from type 'App': onValidate, onPrepare, onSynthesize, validate, and 2 more.
                                                                                                                            
7 new CdkDebugEvbridgeStack(app, 'CdkDebugEvbridgeStack', {                                                                 
                            ~~~                                                                                             
                                                                                                                            
    at createTSError (/root/cdk-debug-evbridge/node_modules/ts-node/src/index.ts:843:12)                                    
    at reportTSError (/root/cdk-debug-evbridge/node_modules/ts-node/src/index.ts:847:19)
    at getOutput (/root/cdk-debug-evbridge/node_modules/ts-node/src/index.ts:1057:36)                                       
    at Object.compile (/root/cdk-debug-evbridge/node_modules/ts-node/src/index.ts:1411:41)
    at Module.m._compile (/root/cdk-debug-evbridge/node_modules/ts-node/src/index.ts:1596:30)                               
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Object.require.extensions.<computed> [as .ts] (/root/cdk-debug-evbridge/node_modules/ts-node/src/index.ts:1600:12)
    at Module.load (node:internal/modules/cjs/loader:988:32)                                                                
    at Function.Module._load (node:internal/modules/cjs/loader:834:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  diagnosticCodes: [ 2345 ]
}

Subprocess exited with error 1

Here's my code:

import * as cdk from '@aws-cdk/core';
import { EventBridgeWebSocket } from 'cdk-eventbridge-socket';

export class CdkDebugEvbridgeStack extends cdk.Stack {
  constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new EventBridgeWebSocket(this, 'CdkDebugEvbridgeSockets', {
      bus: 'default',

      // This example shows how to listen for all events
      eventPattern: {
        account: ['1234567891234'],
      },
      stage: 'dev',
    });
    // The code that defines your stack goes here

    // example resource
    // const queue = new sqs.Queue(this, 'CdkDebugEvbridgeQueue', {
    //   visibilityTimeout: cdk.Duration.seconds(300)
    // });
  }
}
@MaiKaY
Copy link

MaiKaY commented Jul 27, 2022

Hi @rfc2119,
I just saw your issue while browsing through this repository, so sorry in case I miss a bit the context.

As far as I can see this construct is supposed to work with CDK v1 and not CDK v2 as in your case, so I believe that's the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants