You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "CHENJIAMIAN (via GitHub)" <gi...@apache.org> on 2023/12/19 01:35:17 UTC
[I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
CHENJIAMIAN opened a new issue, #19414:
URL: https://github.com/apache/echarts/issues/19414
### Version
5.4.3
### Link to Minimal Reproduction
https://codepen.io/571574085/pen/rNPXPZg
### Steps to Reproduce
Open It, Wait Loaded. Hover Charts.
### Current Behavior
https://codepen.io/571574085/pen/rNPXPZg

### Expected Behavior
empty
### Environment
_No response_
### Any additional comments?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-1863401056
cannot reproduce, works as expected - [Demo Code](https://echarts.apache.org/examples/en/editor.html?c=line-simple&code=PYBwLglsB2AEC8sDeAoWsDGwA2wBOAXLANoDkAxABwAMAYrQIICspANLBddQCLf1sdyAZgDsDAEz92Fel0oiBM2gCFaXUgF1WaWJDDYApkVTp0YAwA8wRUgHE8AQwAmEA9DCwAymAcYA1gZOsAx4Bg6wAMIAFg54YKQ6AL7aZsA4kCDGOmZ4EADmeQaEHA4WEADObNmwpRUACsAQ7kVZpqZgAJ4gRhwYeMDllSltsNgOAEYG2K0j6OO-fnn9AK7QThE4-DbkAGwOIgCclCzV6InV52fDhoVrM-hODj5EZAAyTQawAIyK79Cf4l-H1gQiB_1gABYwZ8WBoksMwGlsONgBZ7rAAGZhMDLULo9DlBwANwMDHKAEkALYOQ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ettI1nSfkbiu1crIxJwSPWa_1T7De2Bs781FG_qbM3UHNVuPct9trRtzsoa7u3u_tOFHR9sRX2rZ_YpwUjdO6QNs6gzjqdL4Qh44mVDuAn8ilg6A0zgtcOT1tKIPgUwEQxdpIIzaGXI-Fc0YYwmpiFydcOANx8uXPyTwAokHEB3YKschA6QQdFfuiVB4iWHqzMeIwJ4cByiwGelo5783bILJewsKqrxqquaWG5ZY3xofvE8yM1anz6trC-m9TBjEmI-I26t9zqNMW0EAAx_xQGgDYREIAm6wGPjUUIY1tEBxGPfM2Ft5rWw7LbFaDtP7IW2m7D2ACXpAJ0uRMBv004h2gTgnO3E4G6R0tQYhicUGpPQenUOWdMmwPEPwmO7ARBGQ8alU
uFlmGzFRlXTGFFa54ybI3fRgZWEvA4XFaglMviUBpvwt6IVYoiSYCzRp9YUCJAANxAA)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "CHENJIAMIAN (via GitHub)" <gi...@apache.org>.
CHENJIAMIAN commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-1867367581
Even after removing the code related to Three.js, the charts still don't appear.'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "markbaydoun (via GitHub)" <gi...@apache.org>.
markbaydoun commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-2252882690
We are having the same bug in our frontend. I've tried downgrading `echarts` to 5.4.1 and `vue-echarts` to 6.6.9, because we recently updated the lockfile in the project and that's the only place where the change could have happened, but the bug still happens. The chart ends up rendering when the page is resized, so I think it's got something to do with how it detects changes and re-renders.
The only way we have been able to "fix" it is by rendering the chart only when a loading state is "false", and show a placeholder otherwise, but this is not ideal, as the loading state of the chart looks much better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "romulocrj (via GitHub)" <gi...@apache.org>.
romulocrj commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-3582125862
I had the same problem when updating my importmap to echarts version 6 at the URL indicated in jsdelivr: 'https://cdn.jsdelivr.net/npm/echarts@6.0.0/+esm'
However, reverting to the previous version, I realized I wasn't using the URL with the version, but rather the URL: 'https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js'. I believe this points to the latest version of eCharts. But the fact is, the chart works with this URL.
Searching this issue, I discovered that if you use the URL: 'https://cdn.jsdelivr.net/npm/echarts@6/dist/echarts.esm.js' in the importmap, the chart works perfectly.
Apparently there is a difference between the esm files in the jsdelivr URLs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-1870612835
put all imported .js files in **Settings**, put your code in **JS section**
[Demo](https://codepen.io/helgasoft/pen/gOEppdb)
📌 please close issue if problem solved
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "wkup (via GitHub)" <gi...@apache.org>.
wkup commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-4582560829
### Same symptom under native ESM import maps (no bundler) — root cause + fix
Landed here with the exact symptom (empty `<canvas>`, but tooltips still show on hover) using **ECharts 6.1.0** loaded through a browser **import map** (Symfony AssetMapper) instead of a real bundler. The cause is specific to how the ESM sub-bundles are served.
**Setup:** each entry point (`echarts`, `echarts/core`, `echarts/charts`, `echarts/components`, `echarts/renderers`) and every `zrender/lib/*` module was vendored as a **separate jsDelivr-bundled file** and wired individually in the import map.
**Two failure modes**, both with the model populated (hence working tooltips) but nothing painted on the canvas:
1. Tree-shaken — `import { use } from 'echarts/core'` + `use([LineChart, GridComponent, CanvasRenderer, ...])` throws at `setOption`: Uncaught TypeError: Cannot read properties of undefined (reading 'get') at cartesian2d (charts-*.js) at getInitialData → init → setOption
2. Full import — `import * as echarts from 'echarts'` (the bundled `index.js` that imports `zrender/lib/*` as bare specifiers): **no error at all**, `chart.getOption().series.length === 1`, canvas is allocated at the right size, but `getImageData()` reports **0 painted pixels**.
**Why:** when the sub-modules load as **distinct ESM module instances**, ECharts' internal singleton registries — notably the coordinate-system registry that `cartesian2d` reads via `CoordinateSystem.get(...)` — are **not shared** across them. `GridComponent` registers `cartesian2d` into one copy of the registry; `LineChart.getInitialData()` reads from another → `undefined`. In the full-import variant the split happens on `zrender`, so the painter is wired to a different instance and silently draws nothing.
**Fix:** serve a single self-contained bundle, so there is exactly one module instance → one registry → one painter. The prebuilt full dist ESM bundle inlines both `zrender` and `tslib` (no external/bare imports): echarts/dist/echarts.esm.min.js // 6.1.0, ~1.1 MB
Symfony AssetMapper `importmap.php`:
```php
// before (broken): split entries — index.js pulls zrender/* as separate modules
'echarts' => ['version' => '6.1.0'],
'echarts/core' => ['version' => '6.1.0'],
'echarts/charts' => ['version' => '6.1.0'],
'echarts/components' => ['version' => '6.1.0'],
'echarts/renderers' => ['version' => '6.1.0'],
'zrender/lib/...' => ['version' => '6.1.0'], // ~45 modules
// after (works): one self-contained file; app code keeps `import * as echarts from 'echarts'`
'echarts' => ['path' => './assets/lib/echarts.esm.min.js'],
Charts render normally afterwards (non-blank canvas, no console error).
TL;DR for anyone on a no-bundler / import-map / SystemJS setup: if you wire the per-module ESM files separately and get an empty canvas (tooltips still work) or cartesian2d … reading 'get', switch to the single dist/echarts.esm.min.js bundle so all internal registries live in one module instance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "JimmyAx (via GitHub)" <gi...@apache.org>.
JimmyAx commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-2130174480
Here is a minimal sample that will reproduce the bug. The canvas is empty but the tooltip shows up when hovered. ECharts must be imported using importmap for the bug to appear. A script tag will work as expected.
JSFiddle: https://jsfiddle.net/saltyprogrammer/ovLq8cd3/1/
For reference the HTML is also provided here, should it no longer reproduce in JSFiddle: [echarts-importmap.html.txt](https://github.com/apache/echarts/files/15438780/echarts-importmap.html.txt)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "CHENJIAMIAN (via GitHub)" <gi...@apache.org>.
CHENJIAMIAN commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-1872569207
> put all imported .js files in **Settings**, put your code in **JS section** [Demo](https://codepen.io/helgasoft/pen/gOEppdb) 📌 please close issue if problem solved
Why does this solve the problem? I don't understand the principle behind it. Can you explain it to me?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "BerndAmend (via GitHub)" <gi...@apache.org>.
BerndAmend commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-1879868022
I have the same issue, I'm unable to get the example (https://echarts.apache.org/handbook/en/get-started/#) working if I use esm. (I only see the tooltip)
```import * as echarts from 'https://esm.run/echarts';```
or
```https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.js```
It works fine if I use
```<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.js"></script>```
I think something is wrong with the esm files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "JimmyAx (via GitHub)" <gi...@apache.org>.
JimmyAx commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-2233047564
Can still be reproduced with Apache ECharts 5.5.1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "vince83110 (via GitHub)" <gi...@apache.org>.
vince83110 commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-3501763959
Same error here, with Echarts 6.0.0, and using Symfony project with Importmap component, impossible to have it to work with ESM. Did anyone find a fix ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] echarts import map bug(empty canvas, but hover can see tips) [echarts]
Posted by "noproblemwiththat (via GitHub)" <gi...@apache.org>.
noproblemwiththat commented on issue #19414:
URL: https://github.com/apache/echarts/issues/19414#issuecomment-5575904893
Issue persists with 6.1.0, I confirm that replacing
```
https://cdn.jsdelivr.net/npm/echarts@6.1.0/+esm
```
by
```
https://cdn.jsdelivr.net/npm/echarts@6.1.0/dist/echarts.esm.min.js
```
fixes it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org