istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.55k stars 353 forks source link

Cannot use it with --all + ESM + Babel #1495

Open dword-design opened 1 year ago

dword-design commented 1 year ago

Link to bug demonstration repository

https://github.com/dword-design/try-nyc-babel-esm

Expected Behavior

The test runs with no error

Observed Behavior

The test runs with a Babel error

Troubleshooting steps

Environment Information

System:
    OS: macOS 12.5.1
    CPU: (8) x64 Apple M1 Pro
    Memory: 20.78 MB / 16.00 GB
  Binaries:
    Node: 14.19.3 - ~/.nvm/versions/node/v14.19.3/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.18.0 - ~/.nvm/versions/node/v14.19.3/bin/npm
  npmPackages:
    @babel/core: ^7.19.3 => 7.19.3 
    @babel/plugin-proposal-pipeline-operator: ^7.18.9 => 7.18.9 
    babel-register-esm: ^1.2.3 => 1.2.3 
    nyc: ^15.1.0 => 15.1.0 

It looks like there is different loading behavior depending on if --all is set in the nyc command.