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
148 stars 6 forks source link

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

Closed Ivanho92 closed 3 months ago

Ivanho92 commented 10 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 10 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 10 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 10 months ago

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

gavinmcfarland commented 3 months ago

So I've looked into this and I believe I've narrowed it down into postcss-values-parser which is causing the error to happen because it uses the postcss.parser. Unfortunately I don't have a way to fix it at thee moment, but I believe it may just be a warning and shouldn't affect the plugin in any way. So for now I will mark as "wontfix". Thanks again.

gavinmcfarland commented 3 months ago

Duplicate of #83