我将使用@ amcharts / amcharts4 @ 4.3.5的应用程序更新为Angular 8,现在在编译它时遇到了问题。
已经将amcharts更新为版本4.4.10。但是问题仍然存在。
ERROR in ./node_modules/@amcharts/amcharts4/.internal/core/export/Export.js 68:24
Module parse failed: Unexpected token (68:24)
You may need an appropriate loader to handle this file type.
| switch (_a.label) {
| case 0: return [4 /*yield*/, Promise.all([
> import(/* webpackChunkName: "pdfmake" */ "pdfmake/build/pdfmake.js"),
| import(/* webpackChunkName: "pdfmake" */ "../../pdfmake/vfs_fonts")
| ])];
答案 0 :(得分:1)
此替代方法对我有用:
npm install --save acorn@6.1.1
npm dedupe
问题出在NPM方面,请查看此处:
https://github.com/amcharts/amcharts4/issues/1002
在AmCharts文档中发现了此问题,使我可以采用上述解决方法:
https://www.amcharts.com/docs/v4/getting-started/integrations/using-webpack/
答案 1 :(得分:0)
此问题的另一种解决方案:
rm -rf node_modules
rm -f package-lock.json
yarn install
看来 NPM 的依赖有问题:/