pdf2json icon indicating copy to clipboard operation
pdf2json copied to clipboard

Getting module error during code build

Open nikunjanchalia opened this issue 3 years ago • 1 comments

Hi

I am a newbie to React and Node.js. I am using the PDF2JSON module as part of my development. When I build the application I get the below error. I am using the latest version (1.2.0). Any advise would be greatly appreciated.

ERROR MESSAGE

ERROR in ./node_modules/pdf2json/pdfparser.js 5:12-27 Module not found: Error: Can't resolve 'util' in '..\pdf-reader\node_modules\pdf2json'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }' - install 'util' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "util": false } @ ./src/components/PdfParser.js 47:18-37 25:0-33 47:6-15 48:19-28 @ ./src/components/PdfReaderApp.js 29:0-36 88:43-52 @ ./src/app.js 3:0-53 5:50-62

webpack 5.5.1 compiled with 15 errors in 1737 ms [webpack-cli] watching files for updates...

nikunjanchalia avatar Nov 25 '20 02:11 nikunjanchalia