ghalex / vue3-charts

Vue3-Charts is an SVG-based charting library that is very easy to use and highly customizable
https://vue3charts.org
MIT License
142 stars 23 forks source link

Compiler can't parse vue3-charts.esm.js #21

Closed JohnWillemse closed 2 years ago

JohnWillemse commented 2 years ago

Hi,

I added vue3-charts to my Vue3 project, but the project won't compile with the following error:

 ERROR  Failed to compile with 1 error                                                    17:30:24

 error  in ./node_modules/vue3-charts/dist/vue3-charts.esm.js

Module parse failed: Unexpected token (6961:20)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|       ]),
|       createElementVNode("g", _hoisted_4$3, [
>         (!_ctx.axis?.primary?.hide)
|           ? (openBlock(), createBlock(_component_axis, {
|               key: 0,

 @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/views/BpvApp.vue?vue&type=script&lang=js 10:0-48 14:11-16 15:10-14 16:10-14
 @ ./src/views/BpvApp.vue?vue&type=script&lang=js
 @ ./src/views/BpvApp.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

I have no idea how to solve this, I'm pretty new to Vue and web development in general. Any suggestions on what I could try?

ghalex commented 2 years ago

See this answer: https://github.com/ghalex/vue3-charts/issues/19#issuecomment-996073899

ghalex commented 2 years ago

In version 1.1.27 I removed optional chaining, so if you update to the latest version this error should be automatically fixed.

JohnWillemse commented 2 years ago

In version 1.1.27 I removed optional chaining, so if you update to the latest version this error should be automatically fixed.

Thank you, it's fixed now!