I've checked multiple related questions but none seems to fit.
I'm using multiple libraries in my web app, importing them inside Vue single file components without too much hassle as follows:
<script>
import { DateTime } from 'luxon'
import Sortable from 'sortablejs'
export default {
// etc...
}
</script>
And I can use DateTime or Sortable or any other library in the code without issues.
I'm now trying to integrate Apache ECharts and it's giving me troubles.
Not so much due to the library itself, but in this case, for some reason when I import * as echarts from 'echarts' as stated in the official tutorial it returns the following error:
Module not found: Error: Can't resolve 'echarts' in '/whatever/folder/the/current/file/is'
"Whatever folder" means /main/src/components when importing from the base component, or /main/src when trying to import and register globally in the main.js file (as indicated in the first method here).
I know I could try the additional vue-echarts module but I really would like to understand why in this case the loader is looking into the current folder and not in node_modules as in the other cases.
NOTES
echartsis present in thenode_modulesfolder together with the other libraries I use without issues- I've tried also
import echarts from 'echarts'
** EDIT **
- Also tried to import submodules, such as
import * from 'echarts/core' - Also tried to use
const echarts = require('echarts') - Having the same issue with Chart.js, but still not with other libraries I was already using... 😳
Any help will be appreciated.
Module not found: Error: Can't resolve 'echarts/core' in '/main/src'package.jsonandpackage-lock.jsonincluded the libraries. What could create issues with newly installed libraries but not with old ones?