When using ecarts, the console reports an error ` resize ` should not be called during main process
This situation may occur in the scenario where echarts is used in combination with Vue 3, especially after the echarts instance is wrapped with Ref.
This article is excerpted from another blog post, the use of echarts 5 in the development of Vue 3
1. Problem analysis
In general, the encapsulation of ecarts chart does not need to expose the ecarts object to the rendering context. If you do intend to declare an echots object as a response, use shallowref
instead of ref
:
// GOOD
const chart = shallowRef<echarts.ECharts>();
// BAD
const chart = ref<echarts.ECharts>();
If you do not use shallowref
, the command line may report an error ‘resize’ should not be called during main process; In fact, any instance created by a third-party library should be processed responsively using shallowref
instead of ref
.
Read More:
- How to Solve Echarts Error: import echarts from ‘echarts‘
- Echars 5.0 Import Error: “export ‘default’ (imported as ‘echarts’) was not found in ‘echarts’
- [Solved] `handle_argument_error‘: ERROR: “rails console“ was called with arguments [“production“]
- [Solved] Vue gaiters console.log error: Unexpected console statement (no-console)
- [Solved] Error: Main class not found or could not be loaded com.jawasoft.
- [Solved] .\main.go:3:6: missing function body .\main.go:4:1: syntax error: unexpected semicolon or newline be
- The showdialog() method in thread/threading. Timer/task reported an error: “before ole can be called, the current thread must be set to single thread unit (STA) mode.”
- [Solved] AS Run main() Error: Could not create task ‘:app:CreateOperatorDemo.main()‘
- The use of vue-echarts and compilation error solutions
- After SpringBoot starts, exit the console directly and display Process finished with exit code 1
- [Solved] Mpvue+Echarts error: ‘regions‘undefined
- Android: Can’t create handler inside thread that has not called Looper.prepare() [Solved]
- Rendering Problems The following classes could not be instantiated: xml layout file could not be loaded
- Go declares that the local variable does not use command line arguments. Main. Go: 4:6: a declared but not used
- [Solved] Echarts Error: Cannot read property ‘init‘ of undefined
- [Solved] Angular Start Project Error: The target entry-point “ngx-echarts“ has missing dependencies: – @juggle/resi
- VUE Echarts Loading Error TypeError: Cannot read property getAttribute of null?
- [Solved] C++ Error: terminate called after throwing an instance of ‘char const‘
- [Solved] Mac M1 Debug Error: could not launch process: can not run under Rosetta
- How to Solve “Status bar could not find cached time string image. Rendering in-process.” in Xcode