Skip to content

[Bug]: 在next项目中使用@ant-design/charts包浏览器控制台不停热重载,终端报.ts文件404错误 #2926

@544680262

Description

@544680262

Describe the bug / 问题描述

项目包管理器使用 pnpm
next版本 15.2.0
react版本 19.0.0
@ant-design/charts版本 2.3.0

Image

Image

以下为部分代码
导包
import { Column } from "@ant-design/charts";

图表配置
const columnConfig = { // 数据源 data: [ { month: "1月", value: 770 }, { month: "2月", value: 1160 }, { month: "3月", value: 860 }, { month: "4月", value: 440 }, { month: "5月", value: 540 }, { month: "6月", value: 440 }, { month: "7月", value: 580 }, { month: "8月", value: 430 }, { month: "9月", value: 840 }, { month: "10月", value: 840 }, { month: "11月", value: 1190 }, { month: "12月", value: 970 }, ], // X轴字段 xField: 'month', // Y轴字段 yField: 'value', // 柱状图颜色 color: '#1890ff', // 图表宽度 width: 700, // 图表高度 height: 300, // X轴配置 xAxis: { label: { style: { fill: '#8c8c8c', // 标签颜色 fontSize: 12, // 标签字体大小 }, }, line: { style: { stroke: '#d9d9d9', // X轴线颜色 }, }, }, // Y轴配置 yAxis: { label: { style: { fill: '#8c8c8c', // 标签颜色 fontSize: 12, // 标签字体大小 }, }, grid: { label: { formatter: (value: any) => { return value; // 格式化标签 } }, line: { style: { stroke: '#d9d9d9', // 网格线颜色 lineDash: [4, 4], // 虚线样式 }, }, }, }, animation: false, columnStyle: { fill: '#1890ff' }, columnWidthRatio: 0.8, marginRatio: 0.2, };

使用
<Col span={24}> <ProCard title={'新闻'}> <Column {...columnConfig} /> </ProCard> </Col>

使用代码注释后不会出现该问题

Reproduction link / 复现链接

No response

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

No response

Version / 版本

Please select / 请选择

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions