sst / console

A web based dashboard for your SST apps
https://console.sst.dev
212 stars 21 forks source link

Cannot read properties of undefined (reading 'handler') #16

Closed aurelien-semence closed 3 weeks ago

aurelien-semence commented 4 weeks ago

I've encountered a console crash in the "local" tab with the following error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'handler')
    at get children (index.c1f2b17c.js:275:89501)
    at Array.uN (index.c1f2b17c.js:1:9105)
    at Array.uN (index.c1f2b17c.js:1:9105)
    at Object.fn (index.c1f2b17c.js:1:16341)
    at rN (index.c1f2b17c.js:1:5243)
    at Bu (index.c1f2b17c.js:1:5184)
    at $t (index.c1f2b17c.js:1:1476)
    at Ne (index.c1f2b17c.js:1:16316)
    at Object.fn (index.c1f2b17c.js:1:21342)
    at rN (index.c1f2b17c.js:1:5243)

This error occurs at these lines:

get children() {
   return e.mixed ? e.function.handler : e.invocation.errors[0]?.message || e.invocation.logs[0]?.message
}

I encounter this error when starting the execution of a state machine. It's a rather simple state machine that triggers only one Lambda function.

I've noted that my Lambda function does not appear in the resources tab, and I suspect the error is related to this issue.

For your information, this works correctly on the old console.

local resources

I would like to add the following details about my stack:

    const notifyStatistics = new Function(stack, 'gaming-notify-statistics', {
        handler: 'packages/_gaming/steps/notifyStatistics',
        environment: {
            ...commonEnvironment,
            ...gamingEnvironment,
            GAMING_API_URL: graphApi.url,
        },
        permissions: [
            ...gamingPermissions,
            new cdk.aws_iam.PolicyStatement({
                actions: ['appsync:GraphQL'],
                effect: cdk.aws_iam.Effect.ALLOW,
                resources: [graphApi.apiArn + '/*'],
            }),
        ],
    })

    const notifyStatisticsStateMachine = new StateMachine(
        stack,
        `${app.stage}-${app.name}-gaming-notify-statistics-state-machine`,
        {
            definitionBody: DefinitionBody.fromChainable(
                new LambdaInvoke(stack, 'NotifyStatisticsTask', {
                    lambdaFunction: notifyStatistics,
                }),
            ),
        },
    )
jayair commented 3 weeks ago

Oh hey this repo is for the newer console: https://console.sst.dev/

You can post this issue on the main sst repo.