Solution:
1. Change
import echarts from 'echarts';
to
import * as echarts from 'echarts';
2. Reinstall echarts and uninstall echars5.x. Install echarts4.x. It can also solve the problem.
Similar Posts:
- [Solved] Vue Import echarts error: Error in mounted hook: “TypeError: Cannot read property ‘init’ of undefined”
- How to Copy Echarts Map Examples to Local vueCLI Project (Commissioning Operation)
- How to Solve Vue Import Chinese Map & Echarts Import China Error
- [Solved] Error: `resize` should not be called during main process.
- ECharts Error: Uncaught Error: `setOption` should not be called during main process
- Vue: How to use Vue-router in Axios
- nmap: Failed to open device ethxxx [How to Solve]
- Syntax Error: TypeError: this.getOptions is not a function [Solved]
- ImportError: cannot import name cbook
- Error: vs2015 does not set the object reference to the instance of the object