tabula-js icon indicating copy to clipboard operation
tabula-js copied to clipboard

loadDiskCache error from tabula-java

Open kcivey opened this issue 6 years ago • 3 comments

I haven't found a real solution, but in case anyone is running into this error, you can just run again and it should work. It creates a ~/.pdfbox.cache file and throws the error the first time it runs, but after that file exists it seems to be OK. Here's the message in case anyone can figure out what's going on.

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: Apr 17, 2019 4:30:04 PM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider loadDiskCache
    at consumer (.../node_modules/highland-process/lib/process.js:56:14)
    at Stream.s._send (.../node_modules/highland/lib/index.js:1560:9)
    at Stream.write (.../node_modules/highland/lib/index.js:1661:18)
    at Stream._send (.../node_modules/highland/lib/index.js:984:26)
    at Stream.write (.../node_modules/highland/lib/index.js:1661:18)
    at Socket.ondata (_stream_readable.js:689:20)
    at Socket.emit (events.js:189:13)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at Socket.Readable.push (_stream_readable.js:220:10)
    at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
Emitted 'error' event at:
    at .../node_modules/highland/lib/index.js:2029:18
    at Stream.s._send (.../node_modules/highland/lib/index.js:1560:9)
    at Stream.write (.../node_modules/highland/lib/index.js:1658:18)
    at Stream._send (.../node_modules/highland/lib/index.js:984:26)
    at push (.../node_modules/highland/lib/index.js:1526:19)
    at .../node_modules/highland/lib/index.js:2212:13
    at Stream.s._send (.../node_modules/highland/lib/index.js:1560:9)
    at Stream.write (.../node_modules/highland/lib/index.js:1658:18)
    at Stream._send (.../node_modules/highland/lib/index.js:984:26)
    at push (.../node_modules/highland/lib/index.js:1526:19)
    at .../node_modules/highland/lib/index.js:3177:13
    at Stream.s._send (.../node_modules/highland/lib/index.js:1560:9)
    at Stream.write (.../node_modules/highland/lib/index.js:1658:18)
    at Stream._send (.../node_modules/highland/lib/index.js:984:26)
    at Stream.write (.../node_modules/highland/lib/index.js:1658:18)
    at .../node_modules/highland/lib/index.js:686:15

kcivey avatar Apr 17 '19 21:04 kcivey

Actually I see now that that's a warning, and the error can be avoided with the silent option. But maybe silent should always be true, since the warnings aren't being handled properly anyway.

kcivey avatar Apr 17 '19 21:04 kcivey

silent is passed to the JAR, it doesn't mean that JS errors are silently caught. This is unclear in the docs.

I'm working on a fork here (published package is up-to-date): https://www.npmjs.com/package/fresh-tabula-js

cdtinney avatar May 21 '19 02:05 cdtinney

Yes, but since this JS error occurs whenever you run it for the first time, it seems like it should be handled some way even if silent is not passed, or perhaps silent should be the default.

kcivey avatar May 21 '19 12:05 kcivey