-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser Console: [ECharts] There is a chart instance already initialized on the dom. #37
Comments
@robertgz fixed in |
Still appears in |
This issue appears not to be solved. const [value, setValue] = useState(0);
useEffect(() => {
setTimeout(() => {
setValue(value);
}, 1);
}); But this is propably the dirtiest quick fix I came up with and I hate it. Addition: the setValue forcing a rerender must also be a dependency in the Chart instance to force the rerender there. |
I can confirm. I'm experiencing same issue here. Any chance it will be fixed ? |
Hi guys, I am currently really busy and I cannot dedicate much time to solve it. It'd great if you could take a look (I can provide details for those who are interested). |
Workaround from @hoeflerjo worked, but definitely I would love to look and see if I can provide PR. :) |
If you could point me to the right direction @hugocxl or if you won't have time I will try to figure out myself what is going on, but it will be probably super slowly ;) |
@piotrzarzycki21 sure. Whenever the react-echarts/src/use-echarts.ts Line 164 in 68f40a9
I tried Not sure what I'm missing here 😕 |
Thank you! :) I will dive into that, won't be quick since I'm busy as well, but this warning drive me crazy in our app. ;) |
@hugocxl I have implemented a solution to this in the PR I created. const setContainerRef = async (node: T) => {
if (!node || node === containerRef.current) return;
if (echartsRef.current) echartsRef.current.dispose();
containerRef.current = node;
echartsRef.current = await setupECharts(node, options);
resizeObserverRef.current = startResizeObserver();
setStarted(true);
}; |
Awesome @brandanking-decently !! Thank you! I run out of time to look into that. I hope it will be merged. |
Still waiting for an update on this getting reviewed. Hopefully soon as this is starting to be a blocker for us |
@brandanking-decently Maybe you can publish your fork on npm if the maintainer is not responsive ? |
Merged and published @brandanking-decently's PR under v1.4.1. Thanks for having the time to look into this 🙏🏻 |
There seems to be a problem with the release :
There is no index.mjs in the dist directory as specified in the module section of the package.json. |
@amarant published a patch. Should be solved now |
@hugocxl yes it works fine now, thanks a lot ! |
Description
I am seeing a browser console messages when a component containing the EChart is rendered multiple times while the chart is initializing. I am not sure if this is an issue or if I need to change how I use the EChart component.
The console message I see when using Chrome is:
[ECharts] There is a chart instance already initialized on the dom.
Link to Reproduction
https://stackblitz.com/edit/stackblitz-starters-6kgmdx?file=app%2Fpage.tsx
Steps to reproduce
JS Framework
Next.js 13 (TS)
Version
1.2.0
Browser
Google Chrome 126
Operating System
Additional Information
If the number used in
setInterval
is increased from 200 to 2000 the console message does not show.The text was updated successfully, but these errors were encountered: