Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsx issue with nyc instumented files: #699

Open
5 of 6 tasks
derdeka opened this issue Feb 12, 2025 · 0 comments
Open
5 of 6 tasks

tsx issue with nyc instumented files: #699

derdeka opened this issue Feb 12, 2025 · 0 comments
Labels
bug Something isn't working pending triage

Comments

@derdeka
Copy link

derdeka commented Feb 12, 2025

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a bug tracker and anything other than a proven bug will be closed
  • I understand this is a free project and relies on community contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://stackblitz.com/edit/node-r2m8mrnc?file=package.json

Problem & expected behavior (under 200 words)

  • What happened

    When using nyc and tsx the instumented files cause an error:
    Cannot read properties of undefined (reading 'startsWith').

    I think this line is causing the issue, as modules don't always have an id:

    if (module.id.startsWith('data:text/javascript,')) {

  • How to repoduce

    Use stackblitz or manual steps:

    npm init -y
    npm i tsx@4.19.2 nyc@17.1.0 --save-dev --save-exact
    echo "node-options=--import=tsx" > .npmrc
    echo "{\"all\": true, \"sourceMap\": true, \"instrument\": true}" > .nycrc.json
    echo "console.log('hello world')" > dummy.js
    npx nyc node dummy.js
  • Screenshots
    Image
    Image

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $10 for financial support
@derdeka derdeka added bug Something isn't working pending triage labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage
Projects
None yet
Development

No branches or pull requests

1 participant