flex-gap-polyfill icon indicating copy to clipboard operation
flex-gap-polyfill copied to clipboard

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

Open Ivanho92 opened this issue 1 year ago • 3 comments

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 ?

Ivanho92 avatar Jan 27 '24 13:01 Ivanho92

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.

gavinmcfarland avatar Jan 28 '24 17:01 gavinmcfarland

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!

Ivanho92 avatar Jan 29 '24 10:01 Ivanho92

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

gavinmcfarland avatar Jan 29 '24 21:01 gavinmcfarland

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 avatar Jul 31 '24 15:07 gavinmcfarland

Duplicate of #83

gavinmcfarland avatar Aug 01 '24 12:08 gavinmcfarland