less / less/less.js

Unable to load plugin (yarn pnp issue?)

Open
#4,367 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

To reproduce:

import { execSync } from 'node:child_process';

execSync(
  'lessc --clean-css="--s1 --advanced --compatibility=ie8" index.less style.css',
  { stdio: 'inherit' },
);

Current behavior:

It seems that less cannot find clean-css.

Unable to load plugin clean-css please make sure that it is installed under or at the same level as less

Expected behavior:

Expected that less would find clean-css.

Environment information:

  • less version: 4.4.1
  • nodejs version: v22.15.0
  • operating system: macos 14.6.1 (23G93)
  • yarn version: 4.9.1
  • less-plugin-clean-css version: 1.6.0
  • clean-css version: 5.3.3

Additional context

  • packages installed as dev deps (yarn add -D) in yarn workspace using pnp
  • script is run with yarn dotenvx run tsx ./script.ts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the command from script.ts with the listed Yarn Plug'n'Play environment, using index.less as the input and style.css as the output. Trace why less cannot load clean-css through less-plugin-clean-css, then verify that the command completes and produces the expected stylesheet without the plugin error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.