sayanee / angularjs-pdf

:page_facing_up: An AngularJS directive <ng-pdf> to display PDF files with PDFJS
http://sayan.ee/angularjs-pdf/
MIT License
494 stars 248 forks source link

Strange Path in the Dist JS file #186

Closed andrew-hamilton-dev closed 7 years ago

andrew-hamilton-dev commented 7 years ago

@dennybiasiolli We are using angularjs-pdf in a webpack2 build setup using karma/instanbul for code coverage and are getting the following error. Now this error isn't preventing our tests from running and completing but it looks like there is a file path baked into the dist js file which probably shouldn't be in it.

Just wanted to give you a heads up.

18 05 2017 15:05:39.746:ERROR [coverage]: { Error: ENOENT: no such file or directory, open '/Users/denny/git/angularjs-pdf/src/angular-pdf.directive.js' at Error (native) at Object.fs.openSync (fs.js:640:18) at Object.fs.readFileSync (fs.js:508:33) at LookupStore.get (/Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/store/fslookup.js:40:19) at HtmlReport.writeDetailPage (/Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/report/html.js:411:67) at /Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/report/html.js:489:26 at SyncFileWriter.writeFile (/Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/util/file-writer.js:57:9) at FileWriter.writeFile (/Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/util/file-writer.js:147:23) at /Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/report/html.js:488:24 at Array.forEach (native) at HtmlReport.writeFiles (/Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/report/html.js:482:23) at /Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/report/html.js:484:22 at Array.forEach (native) at HtmlReport.writeFiles (/Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/report/html.js:482:23) at HtmlReport.writeReport (/Users/ahamilton/workspace/intellitrack-webclient/node_modules/istanbul/lib/report/html.js:566:14) at writeReport (/Users/ahamilton/workspace/intellitrack-webclient/node_modules/karma-coverage/lib/reporter.js:68:16) errno: -2, code: 'ENOENT', syscall: 'open', path: '/Users/denny/git/angularjs-pdf/src/angular-pdf.directive.js' }

dennybiasiolli commented 7 years ago

Thank you @andrew-hamilton-dev for this issue, this was related to the webpack configuration, caused by the inclusion of istanbul plugin in the production builds. We have the PR #187 fixing this issue, thanks again!