Skip to content

options has an unknown property 'config' #472

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

Closed
in-in opened this issue Sep 8, 2020 · 10 comments
Closed

options has an unknown property 'config' #472

in-in opened this issue Sep 8, 2020 · 10 comments

Comments

@in-in
Copy link

in-in commented Sep 8, 2020

  • Operating System: Linux Mint 19.3
  • Node Version: v12.15.0
  • NPM Version: 6.14.4
  • webpack Version: 4.44.1
  • postcss-loader Version: 4.0.0

Expected Behavior

Set custom config files

Actual Behavior

ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'config'. These properties are valid:
   object { postcssOptions?, execute?, sourceMap? }

Code

const style = {
  'test': /\.scss$/,
  'use': [
    'style-loader',
    {
      'loader': 'css-loader',
      'options': {
        'sourceMap': true,
      },
    },
    {
      'loader': 'postcss-loader',
      'options': {
        'config': path.resolve(PATHS.config, 'postcss.config.js'),
        'sourceMap': true,
      },
    },
    {
      'loader': 'sass-loader',
      'options': {
        'sourceMap': true,
      },
    },
  ],
};

According to the documentation, the code above should work.

How Do We Reproduce?

Try using the "config" option for postcss-loader

@equinusocio
Copy link

equinusocio commented Sep 8, 2020

Same issue here. Our workflows are completely blocked cause this and we had to revert it.

@aariacarterweir
Copy link

Yup had to roll back to v3, this is broken in v4

@alexander-akait
Copy link
Member

alexander-akait commented Sep 8, 2020

Please read documentation and changelog before open the new issue:

const style = {
  'test': /\.scss$/,
  'use': [
    'style-loader',
    {
      'loader': 'css-loader',
      'options': {
        'sourceMap': true,
      },
    },
    {
      'loader': 'postcss-loader',
      'options': {
        // All postcss options is now under `postcssOptions`
        'postcssOptions': {
          'config': path.resolve(PATHS.config, 'postcss.config.js'),
        },
        'sourceMap': true,
      },
    },
    {
      'loader': 'sass-loader',
      'options': {
        'sourceMap': true,
      },
    },
  ],
};

@in-in
Copy link
Author

in-in commented Sep 8, 2020

@evilebottnawi please tell me who told you I didn't read the documentation?
Anyway, thank you for your help.

202521599563397

@alexander-akait
Copy link
Member

@in-in my mistake, sorry, WIP on updating docs

@alexander-akait
Copy link
Member

#473

@equinusocio
Copy link

equinusocio commented Sep 8, 2020

@evilebottnawi Next time, as OOS developer, can i suggest that if 3 people share the same issue probably there is something better to say instead of "read the documentation" because you're assuming that 3 people are just stupid.

Said that, thanks for the fast update.

@alexander-akait
Copy link
Member

@equinusocio

Next time, as OOS developer, can i suggest that if 3 people share the same issue probably there is something better to say instead of "read the documentation" because you're assuming that 3 people are just stupid.

Unfortunately sometimes I get a lot more issues, because many developers don't like read notes, I can provide an infinite number of links to this 😄 Anyway I done mistake here

@Nux007
Copy link

Nux007 commented Sep 29, 2020

Please read documentation and changelog before open the new issue:

const style = {
  'test': /\.scss$/,
  'use': [
    'style-loader',
    {
      'loader': 'css-loader',
      'options': {
        'sourceMap': true,
      },
    },
    {
      'loader': 'postcss-loader',
      'options': {
        // All postcss options is now under `postcssOptions`
        'postcssOptions': {
          'config': path.resolve(PATHS.config, 'postcss.config.js'),
        },
        'sourceMap': true,
      },
    },
    {
      'loader': 'sass-loader',
      'options': {
        'sourceMap': true,
      },
    },
  ],
};

Thank's :-)

@imadarif
Copy link

imadarif commented Jun 4, 2021

After updating postcssOptions i got javascript heap memory error

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

6 participants