antvis / antvis/G2

[Bug]: contrastReverse 不支持在服务端执行,ssr 报错

Open
#6,692 0 comments 0 reactions 0 assignees View on GitHub
bug 🐛
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug / 问题描述

```ts
labels: [
{
text: (d) => `${d.action}\n${d.pv}`,
position: 'inside',
transform: [{ type: 'contrastReverse' }],
},
],
```

### Reproduction link / 复现链接

_No response_

### Steps to Reproduce the Bug or Issue / 重现步骤

_No response_

### Version / 版本

Please select / 请选择

### OS / 操作系统

- [x] macOS
- [x] Windows
- [x] Linux
- [x] Others / 其他

### Browser / 浏览器

- [ ] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他

Contributor guide

Open the contributing guide

Research direction

Locate the TypeScript implementation of the `contrastReverse` transform and the server-side rendering path, then reproduce the error with the labels configuration shown in the issue. Done means this transform no longer produces an SSR error for that configuration and its server-rendered output remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.