ncc icon indicating copy to clipboard operation
ncc copied to clipboard

Can't use source-map-explorer with ncc's output

Open onigoetz opened this issue 2 years ago • 1 comments

It's impossible to use source-map-explorer to read the output of an NCC build.

❯ source-map-explorer dist/index.js
dist/index.js
  Your source map refers to generated line 154, but the source only contains 153 line(s).
  Check that you are using the correct source map.

Steps to reproduce

Run commands

mkdir testdir
cd testdir
echo "{}" > package.json
yarn add @vercel/ncc @babel/core source-map-explorer

Create input.js

function babelCore() {
    return require("@babel/core");
}

module.exports = {
    babelCore
}

Run commands

yarn ncc build input.js -s -o dist
yarn source-map-explorer dist/index.js

Running NCC with --no-source-map-register gives the same result.

onigoetz avatar Nov 16 '21 20:11 onigoetz