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

Error: Unable to find entry #21

Closed
DaSchTour opened this issue Aug 14, 2016 · 22 comments
Closed

Error: Unable to find entry #21

DaSchTour opened this issue Aug 14, 2016 · 22 comments

Comments

@DaSchTour
Copy link

I added configuration like described here, and after running i get the following error.
[Error: Unable to find entry for [dev/app/content-types.ts]]

When executing remap-istanbul through gulp everything works fine.

I tested the following setups, with the same result:

        coverageReporter: {
            type: 'json',
            subdir: '.'
        },

        remapIstanbulReporter: {
            src: 'coverage/coverage-final.json',
            reports: {
                html: 'coverage'
            },
            dest : './coverage-source'
        },

and simply

      remapIstanbulReporter: {
          reports: {
              html: 'coverage'
          }
      },
@EarthCitizen
Copy link

I am getting a similar error, but only after upgrading to version 0.2.1

@ghost
Copy link

ghost commented Aug 27, 2016

in karma-remap-instanbul/index.js:

var sourceStore = istanbul.Store.create('memory');
var collector = remap(unmappedCoverage, { sources: sourceStore });

i think key in unmappedCoverage not match with key in sourceStore

@EarthCitizen
Copy link

EarthCitizen commented Aug 29, 2016

The problem for me happens in the HTML report. But when I generate the HTML report from the command line with remap-istanbul, there are no errors. It seems that the problem might be with karma-remap-istanbul.

@ghost
Copy link

ghost commented Aug 29, 2016

i try [email protected] and it worked with no errors

@EarthCitizen
Copy link

I am thinking that this must be an issue with karma-remap-istanbul. I tried the following configurations:

│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]

This works fine.

│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]

This works fine.

│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]

This has the Unable to find entry for error. But, if I run remap-istanbul from the command line:

remap-istanbul -i coverage/coverage.json -o html-report -t html

This works fine using the JSON from the fail above.

I also tried updating istanbul-instrumenter-loader:

│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]

This has the Unable to find entry for error. But again, the running remap-istanbul from the command line works fine.

As can be seen here, by only changing the karma-remap-istanbul version, the html reporting fails. karma-remap-istanbul 0.1.1 works with new and old versions of istanbul-instrumenter-loader, and karma-remap-istanbul 0.2.1 fails with new and old versions of istanbul-instrumenter-loader.

@DaSchTour
Copy link
Author

It's definitely a problem with this karma plugin. My current workaround is, that I created a gulp task with remap-istanbul and it works normaly.

@webmutation
Copy link

webmutation commented Sep 7, 2016

I have the same issue . I have a running remap-istanbul setup working I'm trying to use karma-remap-istanbul to reduce boilerplate (calling posttest) but its not running

07 09 2016 18:17:12.537:ERROR [karma]: [Error: Unable to find entry for [src\app\border-component.ts]]
Error: Unable to find entry for [src\app\border-component.ts]

Is there something more needed in the karma config? Am I missing something?

   preprocessors: {
            "built/app/*.js": ["coverage"]
        },
        // Coverage reporter generates the coverage
        //reporters: ['progress', 'coverage'],
        reporters: ['progress', 'coverage', 'karma-remap-istanbul'],

        coverageReporter: {
            instrumenterOptions: {
                istanbul: { noCompact: true }
            },
            reporters:[
                {type: 'html', subdir: '.' },
                {type: 'json', subdir: '.', file: 'coverage-final.json'}
            ]
        },

        remapIstanbulReporter: {
            src: 'coverage/coverage-final.json',
            reports: {
                lcovonly: 'coverage/lcov.info',
                html: 'coverage'
            }
        }

with posttest call to remap-istanbul was working.

But now I get this error

Error: Unable to find entry for [src\app\border-component.ts]
at MemoryStore.Store.mix.get (C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\store\memory.js:38:19)
at HtmlReport.Report.mix.writeDetailPage (C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\report\html.js:411:67)
at C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\report\html.js:489:26
at SyncFileWriter.extend.writeFile (C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\util\file-writer.js:57:9)
at FileWriter.extend.writeFile (C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\util\file-writer.js:147:23)
at C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\report\html.js:488:24
at Array.forEach (native)
at HtmlReport.Report.mix.writeFiles (C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\report\html.js:482:23)
at C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\report\html.js:484:22
at Array.forEach (native)
at HtmlReport.Report.mix.writeFiles (C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\report\html.js:482:23)
at HtmlReport.Report.mix.writeReport (C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\istanbul\lib\report\html.js:566:14)
at C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\remap-istanbul\lib\writeReport.js:77:22
at C:\DEV\Angular2 Unit Tests Projects\ng2-test-seed-dan\node_modules\amdefine\amdefine.js:125:34
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)

@andy-maca
Copy link

I only have this issue with html type report, no problem with 'lcovonly', but the file path in lcov report is not absolute path.

@EarthCitizen
Copy link

I only have problems with the HTML report as well.

On Wednesday, September 7, 2016, Andyma [email protected] wrote:

I only have this issue with html type report, no problem with 'lcovonly',
but the file path in lcov report is not absolute path.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABCx8c2qXhM7dokgCH4MZ98gr6r8DP0kks5qn7A1gaJpZM4Jj4r-
.

@sachinofficial
Copy link

I am also having same issues with this version of the lib, even downgrading the version doesn't help me I come across issue #2. Any help would be much appreciated. Thanks, +1 for this resolution.

@EarthCitizen
Copy link

@sachinofficial Try either running the remap-istanbul command (see my comments above) or executing the remap-istanbul yourself in the karma done callback:

const karmaServer = new karma.Server(yourConfig, yourCallbackFunction)

@eyablokov
Copy link

remap-istanbul is in 0.6.5-pre now: https://github.com/SitePen/remap-istanbul/blob/master/package.json
Tried to use it keep using karma-remap-istanbul 0.2.1. My tests finished fine.
Please, can someone test it, to know if I'm not alone.

@mat-82
Copy link
Collaborator

mat-82 commented Nov 1, 2016

Hi,
I raised the following PR to fix this issue: #27

Please merge and release, we are looking forward to use karma-remap-istanbul in our project.

Thanks

@gcirone
Copy link

gcirone commented Dec 14, 2016

Me too i have this kind of problem with webpack2/typescrit and inline source maps.. please update the remap-istanbul dependecy.

I just create a simple patch to fix this but i need to be merged or i don't have coverage report in bamboo plan.

remap_istanbul_source_map_fix_.patch.zip

@EarthCitizen
Copy link

EarthCitizen commented Dec 14, 2016

@gcirone Maybe you should do a pull request instead of making a patch?

@mattlewis92
Copy link
Contributor

I've just cut a 0.2.2 release which has this fix: #27 which should solve this issue - please can people try and let me know if it solves the problem?

@mattlewis92
Copy link
Contributor

@gcirone I have this lib already working ok with typescript and webpack2 on a lot of my projects, maybe there's something misconfigured with your build tool? There is an e2e example here which might help 😄

@gcirone
Copy link

gcirone commented Dec 15, 2016

The different between my code and your repo is the source map generation. I use devtool:inline-source-map and awesome-typescript-loader instead of ts-loader is an angular2 project but now i try how do u suggest maybe is better.

@mattlewis92
Copy link
Contributor

The inline source map webpack option doesnt work with typescript, as it only looks at .js files, using the source map plugin with the file extension set is the current only way around this AFAICT. I've also used this with the awesome typescript loader and it should just work as a drop in replacement. The other trick to making this work is using this loader sourcemap-istanbul-instrumenter-loader?force-sourcemap=true

@gcirone
Copy link

gcirone commented Dec 15, 2016

In fact i use istanbul-instrumenter-loader and not the sourcemap-istanbul-instrumenter-loader so i will try in this way.

Thanks @mattlewis92 for your help :)

@DaSchTour
Copy link
Author

Okay, so with gulp and inline sourcemaps it works now. Thx.
Hopefully others commented here that it didn't work can also confirm.

@mattlewis92
Copy link
Contributor

@DaSchTour that's great to hear! 😃

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

9 participants