gavinmcfarland / flex-gap-polyfill

A PostCSS plugin to emulate flex gap using margins
https://gavinmcfarland.github.io/flex-gap-polyfill/
Creative Commons Zero v1.0 Universal
143 stars 6 forks source link

A PostCSS plugin did not pass the `from` option to `postcss.parse`. #89

Open Ivanho92 opened 5 months ago

Ivanho92 commented 5 months ago

In Astro.js, I have applied the following in postcss.config.cjs:

const postcssPresetEnv = require("postcss-preset-env");
const flexGapPolyfill = require("flex-gap-polyfill");

module.exports = {
    plugins: [postcssPresetEnv(), flexGapPolyfill()],
};

But when running the dev local server, it throws the following error: A PostCSS plugin did not pass the "from" option to "postcss.parse". This may cause imported assets to be incorrectly transformed. If you've recently added a PostCSS plugin that rai sed this warning, please contact the package author to fix the issue.

Any idea how I can fix that ?

gavinmcfarland commented 5 months ago

Hi @Ivanho92, someone else came across this issue using Vite but I couldn't work out why this error was being thrown. This plugin doesn't uses postcss.parse so I'm at a loss as to why this error message shows in some cases.

If you have a repo that reproduces this error I could investigate and see if there is any part of the code that's causing this error.

Many thanks, and sorry you're encountering this issue.

Ivanho92 commented 5 months ago

Hey @gavinmcfarland,

Thanks for your response! Sure the repository where I reproduced this was this one.

Let me know if you have trouble reproducing the issue.

Cheers!

gavinmcfarland commented 5 months ago

Great, thank you. Much appreciated. I'll take a look at it this weekend.