使用 pdfjs-dist 报错

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;
| }

更换版本为2.0.943即可

运行 npm i pdfjs-dist@2.0.943 

package.json

"dependencies": {
...
"pdfjs-dist": "^2.0.943",
...
},

相关文章: