SBoudrias / gulp-istanbul

Istanbul unit test coverage plugin for gulp.
MIT License
186 stars 87 forks source link

Cannot read property 'toString' of null #122

Open vinaynb opened 7 years ago

vinaynb commented 7 years ago

I am using gulp istanbul in CI cycle to run automated unit tests code coverage. I am getting this error when running my tests inside a docker container. I am sure as this has something to do with my docker env as there is no error when i modify the dockerfile in certain way (removing a specific command) but i need to keep it that way and hence i need to understand what this error means. Hopefully the reason for this error will give me right pointers to debug my docker commands. screenshot from 2017-05-02 11 08 03

The command in question is cp -R node_modules prod_node_modules

ghost commented 7 years ago

@vinaynb Did you find the reason and solution for this error?

cowwoc commented 1 year ago

In my case this was caused by the following code:

return gulp.src(["src/**/*.ts"], {read: false}).
  pipe(istanbul()).
  pipe(istanbul.hookRequire());

The key here is read: false which causes gulp to send istanbul a list of files, but leaves their contents as null. Removing read: false fixed the problem for me.