Giter Club home page Giter Club logo

Comments (14)

novemberborn avatar novemberborn commented on June 13, 2024

Are these introduced by the source map path rewrite?

from nyc.

jamestalmage avatar jamestalmage commented on June 13, 2024

No, we pass relPath to the instrumentor instead of filename. As I recall it isn't necessary, because most/all the reporters look for the longest common parent path and truncate to that.

It won't be an issue until someone tries to combine with coverage generated outside of nyc

from nyc.

jamestalmage avatar jamestalmage commented on June 13, 2024

Let's punt on the issue until the caching PR is merged. I don't want to rebase that again

from nyc.

riophae avatar riophae commented on June 13, 2024
fs.js:549
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                                                  ^

Error: ENOENT: no such file or directory, open './src/helpers/Users/lifangzhou/Development/react-dynamic-element/src/helpers/__DEV__.js'
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)
    at LookupStore.Store.mix.get (/Users/lifangzhou/Development/react-dynamic-element/node_modules/nyc/node_modules/istanbul/lib/store/fslookup.js:40:19)
    at HtmlReport.Report.mix.writeDetailPage (/Users/lifangzhou/Development/react-dynamic-element/node_modules/nyc/node_modules/istanbul/lib/report/html.js:411:67)
    at /Users/lifangzhou/Development/react-dynamic-element/node_modules/nyc/node_modules/istanbul/lib/report/html.js:489:26
    at SyncFileWriter.extend.writeFile (/Users/lifangzhou/Development/react-dynamic-element/node_modules/nyc/node_modules/istanbul/lib/util/file-writer.js:57:9)
    at FileWriter.extend.writeFile (/Users/lifangzhou/Development/react-dynamic-element/node_modules/nyc/node_modules/istanbul/lib/util/file-writer.js:147:23)
    at /Users/lifangzhou/Development/react-dynamic-element/node_modules/nyc/node_modules/istanbul/lib/report/html.js:488:24
    at Array.forEach (native)

Maybe a related issue?

from nyc.

MoOx avatar MoOx commented on June 13, 2024

Got the same issue as @riophae : absolute path added after local dir. That's weird (something like './src/blah/Users/ME/MY/ENTIRE/PATH/TO/A/RELATIVE/FILE.js)

from nyc.

qasim avatar qasim commented on June 13, 2024

Getting this issue when trying to report coverage to coveralls.

Does my full absolute path twice, so my actual path is /Users/qasim/blah/blah/index.js, and nyc interprets it as ./Users/qasim/blah/blah/index.js, making it think of it as /Users/qasim/blah/blah/Users/qasim/blah/blah/index.js(incorrect).

from nyc.

riophae avatar riophae commented on June 13, 2024

The same with @qasim

from nyc.

bcoe avatar bcoe commented on June 13, 2024

@novemberborn I wonder if some of the fixes for paths outside the working directory might have made this problem more prevalent?

from nyc.

MoOx avatar MoOx commented on June 13, 2024

I can't really remember but I think I was doing something wrong, cause I don't have this issue anymore.

from nyc.

MoOx avatar MoOx commented on June 13, 2024

https://github.com/MoOx/statinamic/blob/ae82471e309cf1b2383f37aa9fb438d6cab81fc4/package.json#L140-L144

from nyc.

novemberborn avatar novemberborn commented on June 13, 2024

@novemberborn I wonder if some of the fixes for paths outside the working directory might have made this problem more prevalent?

I don't think so…? In any case just did #164.

@riophae @qasim could you try with that branch?

@MoOx the change to absolute paths should have fixed an issue with source map sources being absolute and not being resolved correctly against the relative coverage report. If you manage to reproduce the problem could you try with #164?

from nyc.

qasim avatar qasim commented on June 13, 2024

@novemberborn fixed with that branch 👍

from nyc.

riophae avatar riophae commented on June 13, 2024

fixed!

from nyc.

Tom-Dibble avatar Tom-Dibble commented on June 13, 2024

I'm still seeing this bug with remap-istanbul 0.11.0.

Specifically, we have our gulp target generate sourcemaps using gulp-sourcemaps (2.6.4) and a remapping function to put "../../src" in them (which is the path from the built file back to its source map). For example, we have a file at FULLPATH/src/util.ts, which generates JS at FULLPATH/build/src/util.js. In the .map file I see "sourceRoot":"../../src" correctly noted.

However, if I run remap-istanbul to generate the HTML coverage using:

cat coverage/coverage-final.json | ./node_modules/.bin/remap-istanbul --output html-report --type html

I get exceptions like:

Error: Could find source for : "src/FULLPATH/build/src/util.ts"
    at CoverageTransformer.addFileCoverage (/FULLPATH/node_modules/remap-istanbul/lib/CoverageTransformer.js:176:18)
    at /FULLPATH/node_modules/remap-istanbul/lib/CoverageTransformer.js:298:14
    at Array.forEach (native)
    at CoverageTransformer.addCoverage (/FULLPATH/node_modules/remap-istanbul/lib/CoverageTransformer.js:296:24)
    at /FULLPATH/node_modules/remap-istanbul/lib/remap.js:51:13
    at Array.forEach (native)
    at remap (/FULLPATH/node_modules/remap-istanbul/lib/remap.js:50:16)
    at Promise.then (/FULLPATH/node_modules/remap-istanbul/bin/remap-istanbul.js:133:21)
    at process._tickCallback (internal/process/next_tick.js:109:7)

Note that if I switch our sourcemaps to generate absolute paths for sourceRoot ("sourceRoot"="/FULLPATH/src") instead, everything works, except that those .map files will only ever work on my personal machine (or another which happens to have the repo cloned to the same path).

Did this bug surface again, or is this separate from the previously reported 2016 issue?

from nyc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.