apache / apache/echarts

[Bug] - 3D chart fails to render in Angular production build (only) — "Invalid expression"

Open
#20,954 2 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

2.0.8

### Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?code=DwEwlgbgBAVAdgcwJIDMC8ByAxgCwIYBOALgPIAORYA9nAM4B0tApgWE7VAIRppQCucEExRg4TEFABkkqLkKkK1OoxZsGAGyaIiOKAD4oABgwBYAFBRLVq0znFa5604DaVRTVoBdTHYWUPphZOVs6iYH5emADeBFpCsQQAXFAARFh4cBB4tCkANFAA7mAgOskpeHxEVCkAvoHBVljq2bQ--MQAtFg0RHiiLBh6jlbAAPTgEENBlsOWYAC2ZFTEUBi27US0HQjqGADcs1CHshvk_nTJAMJ8tFXzAKKXG7RnSlC8UcdWzKzsyc6eXKHGoHMyOHRgBi-V4ed5QT7TBqWBCsEAAZgAIskEUjghA2AVLj0CFR1NivrioOBbhksExkgAmBmGIGIymWeZ4AAeGMhvTgdOSaMMLIpDRqrPZUAlYusXIAglzIZjsTK2Q0AJ6K5VY-FqqUAL21tBVesl7J-an-sqcOKlViIGrI9NWtHSRCILExGHN9qpeF61vVUqiUCy6j4LucLKM-UMgKgzQARkwyat5Rhpb6_fCw3gI1GAIwx4v5YsJ5Op5IYABCmf1OcBNuCtA18yTpIAymADS7S82nOEmPNO47NNjZKTltWAMQoFAikX17NSytp0O0HBUArJIgESNZgeWBuUpvBpw2mpQPZAA

### Steps to Reproduce

This occurs even with a minimal chartOptions configuration:

```ts
this.chartOptions = {
grid3D: { viewControl: { distance: 200 } },
xAxis3D: {},
yAxis3D: {},
zAxis3D: {},
series: [
{
type: 'scatter3D',
data: [{ value: [0, 0, 0] }],
},
],
};
```

No postEffect, no formatter, no projection is being used.

### Current Behavior

In development (ng serve), the chart renders correctly.

In production (ng build --configuration production), chart fails to render with the error above.

I already tried modifying the angular.json file to not minify or tree shake when building, and the error still keeps occurring.

![Image](https://github.com/user-attachments/assets/8b2e7381-918b-4eaf-b6cd-20f14b7908c1)

### Expected Behavior

I would expect that in production the 3D sine plot can be graphed without errors, just as it happens in the local environment.

### Environment

```markdown
echarts: 5.4.2

echarts-gl: 2.0.8 (also reproduced with 2.0.7)

ngx-echarts: 15.0.3

Angular: 15.2.3
```

### Any additional comments?

I have in the imports of my app.module.ts:
NgxEchartsModule.forRoot({
echarts: async () => import('echarts'),
}),

and then in my specific component that attempts to render a 3D graphic:
import 'echarts-gl';
....

Luego del build, puedo ver en el main.js los tipos como "scatter3D" y "line3D"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.