react应用程序中pdfjs-dist的附加加载程序?

我的pdfjs-distreact 应用程序中有依赖项,但它不起作用 - 我不确定我更改了什么导致了这种情况。我跑node v14.16.1npm v7.9.0react 17.0.2react-scripts 4.0.3,和pdfjs-dist 2.7.570。我在运行时收到以下错误消息npm start

Failed to compile.

./node_modules/pdfjs-dist/build/pdf.js 2407:53
Module parse failed: Unexpected token (2407:53)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|                 intent: renderingIntent,
|                 renderInteractiveForms: renderInteractiveForms === true,
>                 annotationStorage: annotationStorage?.getAll() || null
|               });
|             }

我已经尝试卸载并重新安装相关软件包,以及npm updatenpm audit等等。我也尝试添加worker-loadernpm 包,但它已经是对 pdfjs-dist 的对等依赖,因此没有任何区别。我在这个项目上的合作伙伴有相同的回购,他没有问题,所以我确定这是我的问题。我相信这与对可选链接的支持有关,但不确定如何进行。谢谢!

以上是react应用程序中pdfjs-dist的附加加载程序?的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>