antvis / antvis/L7

@antv/l7-component ES build imports .less source files since v2.24.0, requiring consumers to install less preprocessor

Open
#2,844 2 comments 1 reaction 1 assignee Claimed by @lzxue View on GitHub
bug
Dominant language
TypeScript
Stars
4.1k
Forks
656
PR merge metrics
No merged PRs in 30d

Description

Description:

Starting in v2.24.0, @antv/l7-component/es/index.js has an
active .less import:

import "./css/index.less";

In v2.23.x and earlier, this was commented out:

// import './css/index.less';

This breaks builds for any project that depends on @antv/l7
transitively (e.g. via @ant-design/maps or
@ant-design/charts) without having less installed as a dev
dependency.

Error: Preprocessor dependency "less" not found. Did you
install it?

Expected behavior:
Published ES module builds should ship compiled CSS
(index.css), not preprocessor source files. Consumers should
not need to install less to use this package.

Reproduction:
1. Install @ant-design/charts (which pulls @ant-design/maps →
@antv/l7 → @antv/l7-component)
2. Build with Vite (or any bundler) without less installed
3. Build fails on @antv/l7-component/es/css/index.less

Workaround:
Pin @antv/l7 and @antv/l7-component to 2.23.2 via yarn/npm
resolutions.

Versions affected: 2.24.0 – 2.25.4 (latest)

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.