Skip to content

PrettyError not supported anymore results in an error #1264

Open
@Martin1982

Description

@Martin1982

When running yarn build the build fails for using require instead of ESM in what seems a Webpack Encore dependency;

[webpack-cli] Error [ERR_REQUIRE_ESM]: require() of ES Module /var/www/app/node_modules/strip-ansi/index.js from /var/www/app/node_modules/renderkid/lib/RenderKid.js not supported.
Instead change the require of index.js in /var/www/app/node_modules/renderkid/lib/RenderKid.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/var/www/app/node_modules/renderkid/lib/RenderKid.js:22:13)
    at Object.<anonymous> (/var/www/app/node_modules/pretty-error/lib/PrettyError.js:14:13)
    at Object.<anonymous> (/var/www/app/node_modules/@symfony/webpack-encore/lib/utils/pretty-error.js:12:21)
    at Object.<anonymous> (/var/www/app/node_modules/@symfony/webpack-encore/lib/EncoreProxy.js:14:21)
    at Object.<anonymous> (/var/www/app/node_modules/@symfony/webpack-encore/index.js:13:21)
    at Object.<anonymous> (/var/www/app/webpack.config.js:2:16) {
  code: 'ERR_REQUIRE_ESM'
}

Yarn version; yarn run v1.22.21
Webpack encore version; 4.6.1

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