Skip to content

Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/cdk-assets/node_modules/brace-expansion/index.js #597

@theprivileges

Description

@theprivileges

Assets step on CDK Codepipeline started to fail today due to a breaking change in brace-expansion.

Logs are displaying the following error:

/usr/local/lib/node_modules/cdk-assets/node_modules/minimatch/dist/commonjs/index.js:7
const brace_expansion_1 = __importDefault(require("brace-expansion"));
                                          ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/cdk-assets/node_modules/brace-expansion/index.js from /usr/local/lib/node_modules/cdk-assets/node_modules/minimatch/dist/commonjs/index.js not supported.
Instead change the require of /usr/local/lib/node_modules/cdk-assets/node_modules/brace-expansion/index.js in /usr/local/lib/node_modules/cdk-assets/node_modules/minimatch/dist/commonjs/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/usr/local/lib/node_modules/cdk-assets/node_modules/minimatch/dist/commonjs/index.js:7:43) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.18.2

I managed to find this issue in minimatch - isaacs/minimatch#257

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions