Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rejhgadellaa opened this issue May 28, 2022 · 0 comments
Open

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

rejhgadellaa opened this issue May 28, 2022 · 0 comments

Comments

@rejhgadellaa
Copy link

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()],}],
  ]
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant