peterramsing / lost

LostGrid is a powerful grid system built in PostCSS that works with any preprocessor and even vanilla CSS.
http://lostgrid.org
MIT License
4.5k stars 161 forks source link

Error when using with precss #440

Closed mverissimo closed 5 years ago

mverissimo commented 5 years ago

For support questions you might try tweeting me @lostgrid first.


Is this a feature request or a bug report? Bug

What is the current behavior? When I try to use the lost grid with precss and postcss(gulp), the following error is returned Plumber found unhandled error:

TypeError in plugin "gulp-postcss" Message: Cannot destructure property file of 'undefined' or 'null'. Details: fileName: /home/matheus/Desktop/---/src/assets/style/main.css

Stack: TypeError: Cannot destructure property file of 'undefined' or 'null'. at importPromise.then (/home/matheus/Desktop/----r/node_modules/postcss-advanced-variables/index.js:310:7)

If it's a bug please provide the steps to reproduce it and maybe some code samples.

module.exports = ({ env }) => {
  const global = [
    require('stylelint'),
    require('postcss-easy-import')({
      partial: false,
      extensions: ['.css'],
      glob: true
    }),
    require('lost'),
    require('precss'),
    require('autoprefixer')({ browsers: ['last 2 versions'] }),
    require('css-mqpacker'),
    require('postcss-pxtorem')({
      replace: false
    }),
    require('postcss-custom-media'),
    require('postcss-position')
  ];

  const production = [
    require('cssnano'),
    require('@fullhuman/postcss-purgecss')({
      content: ['./build/**/*.html']
    })
  ];

  /**
   * Merge global plugins with production
   */
  const merge = env => {
    if (env === 'production') {
      return [...global, ...production];
    }

    return global;
  };

  return {
    plugins: merge(env)
  };
};

What version of LostGrid, browser and browser version are affected by this issue? Did this happen in previous versions? lost - 8.4.3 gulp - 3.9.1 gulp-postcss - 8.0.0

HoraceShmorace commented 4 years ago

@mverissimo I'm curious why you closed this? Did you solve it? I'm getting this same error.

mverissimo commented 4 years ago

@HoraceShmorace Honestely I don't remember, I think was something with plugins order