使用“pdfjs”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
| });
| } 如何解决这个问题?任何解决办法或建议都会有很大帮助!
发布于 2021-09-29 07:29:17
我也遇到过同样的错误。这对我有用,也许对你有用
"fileReplacements": [
{
"replace": "./node_modules/jspdf/dist/jspdf.es.min.js",
"with": "./node_modules/jspdf/dist/jspdf.umd.min.js"
}
],在angular.json文件中,
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
place the above code here....
........
}https://stackoverflow.com/questions/67641075
复制相似问题