Skip to content

Can't require package (v5.0.1) #216

@ghost

Description

I'm trying to analyze a react app build files source-map-explorer 'build/static/js/*.js' , but I'm getting this error:

> [email protected] analyze
> source-map-explorer 'build/static/js/*.js'

\my-project\node_modules\wrap-ansi\node_modules\string-width\index.js:3
const isFullwidthCodePoint = require('is-fullwidth-code-point');
                             ^

Error [ERR_REQUIRE_ESM]: require() of ES Module \my-project\node_modules\is-fullwidth-code-point\index.js from \my-project\node_modules\wrap-ansi\node_modules\string-width\index.js not supported.
Instead change the require of \my-project\node_modules\is-fullwidth-code-point\index.js in \my-project\node_modules\wrap-ansi\node_modules\string-width\index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (\my-project\node_modules\wrap-ansi\node_modules\string-width\index.js:3:30)
    at Object.<anonymous> (\my-project\node_modules\wrap-ansi\index.js:2:21)
    at Object.<anonymous> (\my-project\node_modules\source-map-explorer\node_modules\cliui\build\index.cjs:293:14)
    at Object.<anonymous> (\my-project\node_modules\source-map-explorer\node_modules\yargs\build\index.cjs:2861:12)
    at Object.<anonymous> (\my-project\node_modules\source-map-explorer\node_modules\yargs\index.cjs:5:30)
    at Object.<anonymous> (\my-project\node_modules\source-map-explorer\bin\cli.js:10:33) {
  code: 'ERR_REQUIRE_ESM'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions