Javascript '中的模块分析错误;pdfjs区';角模

Javascript '中的模块分析错误;pdfjs区';角模,javascript,angular,pdf,Javascript,Angular,Pdf,尝试在中使用“pdfjs dist”npm模块构建项目时出现以下错误 Module parse failed: Unexpected token (2413:45) File was processed with these loaders: * ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js * ./node_modules/@ngtools/webpack/src/ivy/index.js

尝试在中使用“pdfjs dist”npm模块构建项目时出现以下错误

Module parse failed: Unexpected token (2413:45)
File was processed with these loaders:
 * ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
 * ./node_modules/@ngtools/webpack/src/ivy/index.js
You may need an additional loader to handle the result of these loaders.
|         intent: renderingIntent,
|         renderInteractiveForms: renderInteractiveForms === true,
>         annotationStorage: annotationStorage?.getAll() || null
|       });
|     } 
如何解决这个问题?
任何解决方法或建议都会大有帮助

此错误可以通过将“pdfjs dist”模块版本从2.7.570降级到较低的稳定版本(如2.5.207)来修复

另一个修复方法可能是将webpack的版本从4.x升级到5.x,但这不是一个推荐的解决方案,因为这可能会导致项目的其他依赖模块出现问题