Skip to content

bref:cli command fails in v3 - "Cannot read properties of undefined (reading 'eu-west-1')" #2048

@ddeboer

Description

@ddeboer

Description

The serverless bref:cli command fails in Bref v3 (3.0.0-beta2) with:

TypeError: Cannot read properties of undefined (reading 'eu-west-1')
    at getConsoleLayerArn (vendor/bref/bref/plugin/run-console.js:49:35)

Root Cause

In plugin/run-console.js, the getConsoleLayerArn() function tries to access layers.console[region], but layers.json no longer has a "console" key in v3.

The v3 architecture correctly uses unified php-XX layers with BREF_RUNTIME=Bref\ConsoleRuntime\Main, but run-console.js wasn't updated to find console functions using this new approach.

Suggested Fix

Update getConsoleFunction() to find functions by checking for:

  • BREF_RUNTIME=Bref\ConsoleRuntime\Main environment variable, or
  • php-XX-console runtime designation

Remove the now-unused getConsoleLayerArn() function.

Workaround

Use serverless invoke --function console --data "..." directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions