Skip to content

Something in for.js breaks less v4 each() #13

Open
@rejhgadellaa

Description

@rejhgadellaa

Just wanted to drop this here:

I have a project that uses rollup-plugin-postcss with postcss-less and when I tried to add less-plugin-lists it broke the build:

[!] (plugin commonjs--resolver) Error: Error evaluating function `each`: Cannot read properties of undefined (reading 'slice')

The error was thrown when the parser hit an each() in a .less file.

I've poked a bit at the problem and it looks like something in for.js breaks Less' own each(). As soon as I remove the line

require("./for")(less, manager);

from main.js, everything works fine.

Relevant rollup config:

import postcss from 'rollup-plugin-postcss';
import autoprefixer from 'autoprefixer';
import postcssImport from 'postcss-import';

{
  minimize: true,
  plugins: [
    autoprefixer,
    postcssImport,
  ],
  use: [
    ['less', {plugins: [new LessPluginLists()],}],
  ]
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions