Encountering an error in my Vue 2 project after compilation:
Failed to compile.
./node_modules/vue-chartjs/dist/index.js 85:11-26
"export 'defineComponent' was not found in 'vue'
The specific line in the above file triggering this issue is:
import { defineComponent, shallowRef, ref, watch, onMounted, onBeforeUnmount, toRaw, h, isProxy } from 'vue';
All imports like these are causing the same error. The problem arose after upgrading vue-chartjs from version 3.5.1 to version 4.1.1 (it worked fine before). Seeking insights into the potential cause of this.
The dependencies versions being used are:
- "chart.js": "^3.8.0"
- "vue": "^2.6.14"
- "vue-chartjs": "^4.1.1"
Unfortunately, unable to provide a code snippet as it's occurring only in a work project. When tested on a clean project, compilation is successful. There seems to be limited information available online regarding Vue issues, so any ideas or suggestions would be greatly appreciated.
If you have any thoughts on what could potentially be causing this, please share. Even the smallest suggestion could prove helpful, as I've been struggling with this for days without finding a solution. Upgrading chart.js seemed like a simple task, but it has turned into a lengthy ordeal, quite frustrating!