Giter Club home page Giter Club logo

Comments (8)

aoberoi avatar aoberoi commented on July 24, 2024 3

Just another data point:

I tried added a custom parser to my config, hoping to suppress the warning since it seems like it is asking for at least one of those config properties. I added postcss-scss as my parser, and I still got the warning.

I also tried renaming my files to end in the .scss extension, because I didn't know if that would matter. Still got the warning.


I did a little more digging, and found that the Processor#process method is being called twice. The first time the self.plugins array contains one value, null. The second time self.plugins is an empty array. The warning is generated that second time.

My theory is that when this plugin encounters an @import, it asks postcss to process the target file, but doesn't pass along the config properly. That might be why the second time the method is run it finds an empty plugins array.

PS. I'm curious why the first time the method is called it has a single null in that array, but I don't know anything about postcss internals. It just seems odd.

from postcss-advanced-variables.

jdelStrother avatar jdelStrother commented on July 24, 2024

I think I'm seeing this when @importing a css file from inside node_modules.

from postcss-advanced-variables.

gjhltn avatar gjhltn commented on July 24, 2024

Have got a minimal case now.

This file compiles without error

@import 'included.css';

This file generates the error

.some-class {
  @import 'included.css';
}

from postcss-advanced-variables.

jonathantneal avatar jonathantneal commented on July 24, 2024

I don’t think I have ever supported @import within a rule. How might this be related to the recent major release?

from postcss-advanced-variables.

gjhltn avatar gjhltn commented on July 24, 2024

😢

my minimal case works in 2.3.2 - just my luck if this was accidental all along! :-)

from postcss-advanced-variables.

gjhltn avatar gjhltn commented on July 24, 2024

btw an example of why this behaviour is really useful: namespaced themes, by doing

a.css

$colour=#0f0;

.theme-a {
  @import 'everything.css';
}

b.css

$colour=#f00;

.theme-b {
  @import 'everything.css';
}

the unexpected thing is that despite the error message, the right css is generated. ¯_(ツ)_/¯

from postcss-advanced-variables.

aoberoi avatar aoberoi commented on July 24, 2024

i'm also experiencing this warning, seemingly for no reason. my minimum test case is as follows:

Invoked postcss using postcss-cli (v6.1.0). This includes postcss version 7.0.7.

$ postcss styles/test.css -o output.css

Using the following postcss.config.js in the cwd:

module.exports = {
  plugins: [
    require('postcss-advanced-variables')(),
  ],
};

On the following file (styles/test.css):

@import './test_include.css'

With the following file sitting beside it (styles/test_include.css):

p {
  padding: 16px;
}

In fact, even if i make styles/test_include.css completely blank, I still get the warning.

from postcss-advanced-variables.

romainmenke avatar romainmenke commented on July 24, 2024

I think PostCSS no longer produces this warning.

from postcss-advanced-variables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.