user3034559
user3034559

Reputation: 1329

amcharts3 and ammap3 Parenthesized pattern error

I used npm install two modules in my webpack project: 1, npm install amcharts/amcharts3 2, npm install amcharts/ammap3

but got below error when i run 'npm start', does anyone know how to fix it? Thanks in advance.

ERROR in ./~/amcharts3/amcharts/serial.js Module parse failed: /Users/xx/Documents/xx/node_modules/amcharts3/amcharts/serial.js Parenthesized pattern (54:249) You may need an appropriate loader to handle this file type. @ multi (webpack)-dev-server/client?http://localhost:3000 ./src/main.browser.ts

ERROR in ./~/ammap3/ammap/ammap.js Module parse failed: /Users/xx/node_modules/ammap3/ammap/ammap.js Parenthesized pattern (173:426) You may need an appropriate loader to handle this file type.

Upvotes: 0

Views: 425

Answers (1)

Boyd Dames
Boyd Dames

Reputation: 70

EDIT 2: They seem to have released a hotfix in acorn. If you upgrade to 4.0.8 it will be fixed.

npm install --save [email protected]

EDIT: It seems to be an issue with Webpack's dependency acorn. The acorn version 4.0.7 seems to break quite a lot of packages (related). A temporary workaround would be to lock the acorn dependency to a lower version:

// If webpack is a devDependency
$ npm install --save-dev [email protected]

// If webpack is a production dependency
$ npm install --save [email protected]

If you're using an npm-shrinkwrap.json file, you might want to change it to something like this:

"acorn": {
  "version": "4.0.4",
  "from": "acorn@>=4.0.4 <5.0.0",
  "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.4.tgz"
},

Upvotes: 3

Related Questions