小编sha*_*han的帖子

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
|               });
|             }
Run Code Online (Sandbox Code Playgroud)

我已经尝试卸载并重新安装相关软件包,以及npm updatenpm audit等等。我也尝试添加 …

javascript node.js npm reactjs pdfjs-dist

7
推荐指数
2
解决办法
4777
查看次数

标签 统计

javascript ×1

node.js ×1

npm ×1

pdfjs-dist ×1

reactjs ×1