[Solved] Vue pdfjs-dist Error: Module parse failed: Unexpected token (2267:39)

Use pdfjs-dist Error:

Module parse failed: Unexpected token (2267:39)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| async getXfa() {
> return this._transport._htmlForXfa?.children[this._pageIndex] || null;
| }

Solution:

Change the version to 2.0.943
Run npm i [email protected]
package.json”dependencies”: {

“pdfjs-dist”: “^2.0.943”,

},

Similar Posts: