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

HTML reporter reports 'Unable to lookup source' #1475

Closed
jackson-at-bentley opened this issue Jun 25, 2022 · 6 comments
Closed

HTML reporter reports 'Unable to lookup source' #1475

jackson-at-bentley opened this issue Jun 25, 2022 · 6 comments

Comments

@jackson-at-bentley
Copy link

jackson-at-bentley commented Jun 25, 2022

Link to bug demonstration repository

🍫☕️

Expected behavior

I attempted to follow the installation instructions at istanbul.js.org. I expect the HTML report generated by nyc mocha to have working links to view the coverage of each source file.

Observed behavior

observed.mov
Unable to lookup source: /Users/jackson/Documents/mocha/src/file:/Users/jackson/Documents/mocha/src/hello.ts (ENOENT: no such file or directory, open '/Users/jackson/Documents/mocha/src/file:/Users/jackson/Documents/mocha/src/hello.ts')
Error: Unable to lookup source: /Users/jackson/Documents/mocha/src/file:/Users/jackson/Documents/mocha/src/hello.ts (ENOENT: no such file or directory, open '/Users/jackson/Documents/mocha/src/file:/Users/jackson/Documents/mocha/src/hello.ts')
    at Context.defaultSourceLookup [as sourceFinder] (/Users/jackson/Documents/mocha/node_modules/istanbul-lib-report/lib/context.js:17:15)
    at Context.getSource (/Users/jackson/Documents/mocha/node_modules/istanbul-lib-report/lib/context.js:71:21)
    at annotateSourceCode (/Users/jackson/Documents/mocha/node_modules/istanbul-reports/lib/html/annotator.js:232:40)
    at HtmlReport.onDetail (/Users/jackson/Documents/mocha/node_modules/istanbul-reports/lib/html/index.js:414:33)
    at Visitor.value (/Users/jackson/Documents/mocha/node_modules/istanbul-lib-report/lib/tree.js:38:38)
    at ReportNode.visit (/Users/jackson/Documents/mocha/node_modules/istanbul-lib-report/lib/tree.js:88:21)
    at /Users/jackson/Documents/mocha/node_modules/istanbul-lib-report/lib/tree.js:92:19
    at Array.forEach ()
    at ReportNode.visit (/Users/jackson/Documents/mocha/node_modules/istanbul-lib-report/lib/tree.js:91:28)
    at ReportTree.visit (/Users/jackson/Documents/mocha/node_modules/istanbul-lib-report/lib/tree.js:127:24)

Troubleshooting steps

Environment information

  System:
    OS: macOS 12.4
    CPU: (8) arm64 Apple M1
    Memory: 272.58 MB / 16.00 GB
  Binaries:
    Node: 18.4.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.12.1 - /opt/homebrew/bin/npm
  npmPackages:
    nyc: ^15.1.0 => 15.1.0
    source-map-support: ^0.5.21 => 0.5.21
    ts-node: ^10.8.1 => 10.8.1
    typescript: ^4.7.4 => 4.7.4
@amykhaylyshyn
Copy link

I'm getting the same error :(

@urska19
Copy link

urska19 commented Jun 27, 2022

I was having the same issue. Downgrading to ts-node: 10.8.0 resolved it for me. Hope it helps.

@pfedan
Copy link

pfedan commented Jun 27, 2022

same error here.

Downgrading to ts-node: 10.8.0 resolved it for me.

helped!

@pfedan
Copy link

pfedan commented Jun 27, 2022

@coreyfarrell @bcoe
There's an ongoing discussion about this problem on ts-node's side: TypeStrong/ts-node#1790

According to them, it might as well be a bug on nyc's side.

@pfedan
Copy link

pfedan commented Jun 28, 2022

It seems that the change is about to be rolled back: TypeStrong/ts-node#1797 (comment)

@jackson-at-bentley
Copy link
Author

Closing, this has been fixed in ts-node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants