less / less/less-plugin-autoprefix

lessc : source-map with auto-prefix plugin make an error

Open
#42 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
169
Forks
29
PR merge metrics
No merged PRs in 30d

Description

When using less-plugin-autoprefix with the --source-map option ; the CSS file is generated but lessc exit with an error :
(Rq: changing --source-map to --source-map-map-inline avoid the error)

cmd.exe /D /C call C:\......\node_modules\.bin\lessc.cmd --source-map --autoprefix test.less test.css
internal/fs/utils.js:793
  throw new ERR_INVALID_ARG_TYPE(
  ^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of SourceMapGenerator
    at writeFile (fs.js:1487:5)
    at go$writeFile (C:\......\node_modules\graceful-fs\graceful-fs.js:138:14)
    at Object.writeFile (C:\......\node_modules\graceful-fs\graceful-fs.js:135:12)
    at writeSourceMap (C:\......\node_modules\less\bin\lessc:183:10)
    at writeSourceMapIfNeeded (C:\......\node_modules\less\bin\lessc:207:7)
    at C:\......\node_modules\less\bin\lessc:299:11
    at C:\......\node_modules\less\bin\lessc:237:11
    at C:\......\node_modules\graceful-fs\graceful-fs.js:143:16
    at C:\......\node_modules\graceful-fs\graceful-fs.js:61:14
    at FSReqCallback.oncomplete (fs.js:180:23) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Process finished with exit code 1

Command executed by a "file watcher" of JetBrain IDE (PHPStrom). All parameters by default except adding --autoprefix
lessc installed locally as "devDependencies".

Contributor guide

No contributing guide indexed for this repository

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 issue with the shown lessc command using --source-map and --autoprefix. Trace the writeSourceMap and writeSourceMapIfNeeded paths named in the stack trace; done means the CSS and source map are generated without the ERR_INVALID_ARG_TYPE failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.