Skip to content

Error "[object Object] is not a PostCSS plugin" when using with Laravel Mix #145

@Nikschavan

Description

@Nikschavan

Laravel Mix internally uses webpack and allows you to add postcss plugins.

I am trying to use it with postcss-flexibility, although I am seeing this following error log -
This error only happens with this postcss plugin, I tried a few other plugins and this error does not seem to occur.

✖ Mix
  Compiled with some errors in 296.11ms

ERROR in ./sass/site/navigation/menu-animation.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
Error: [object Object] is not a PostCSS plugin
    at Processor.normalize (/Users/Nik/Projects/path/to/node_modules/postcss/lib/processor.js:63:15)
    at new Processor (/Users/Nik/Projects/path/to/node_modules/postcss/lib/processor.js:10:25)
    at postcss (/Users/Nik/Projects/path/to/node_modules/postcss/lib/postcss.js:26:10)
    at Object.loader (/Users/Nik/Projects/path/to/node_modules/postcss-loader/dist/index.js:96:17)
    at processResult (/Users/Nik/Projects/path/to/node_modules/webpack/lib/NormalModule.js:701:19)
    at /Users/Nik/Projects/path/to/node_modules/webpack/lib/NormalModule.js:807:5
    at /Users/Nik/Projects/path/to/node_modules/loader-runner/lib/LoaderRunner.js:399:11
    at /Users/Nik/Projects/path/to/node_modules/loader-runner/lib/LoaderRunner.js:251:18
    at context.callback (/Users/Nik/Projects/path/to/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at Object.loader (/Users/Nik/Projects/path/to/node_modules/postcss-loader/dist/index.js:142:7)

1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)

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