GithubHelp home page GithubHelp logo

Comments (16)

mrmlnc avatar mrmlnc commented on September 21, 2024 27

As I understand it, the problem applies to environments that do not have settings for autoprefixer.

Looks like this is related to autoprefixer updates or something around it.

Most likely this is related to defaults settings in the browserslist.

With common settings this plugin works as expected:

// Place your settings in this file to overwrite default and user settings.
{
	"autoprefixer.options": {
		"browsers": [
			"last 4 versions",
			"ie >= 9",
			"> 5%"
		]
	}
}

So, in this case, this is the correct behavior. Just add the settings for the autoprefixer.

from vscode-autoprefixer.

ddawdler avatar ddawdler commented on September 21, 2024 3

I can confirm this fixes the issue. Thank you for explaining! :)

from vscode-autoprefixer.

ddawdler avatar ddawdler commented on September 21, 2024 2

I'm having the same issue with the same error. Is it possible to downgrade the extension on my machine?

Sure! To install the previous version, go to your extensions, click the little cog wheel icon on the Autoprefixer extension and choose "Install Another Version". I installed 3.0.0 and it works great on my machine.

from vscode-autoprefixer.

ddawdler avatar ddawdler commented on September 21, 2024 1

Sure, here's an example of the CSS I most often prefix with the extension:

.test {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    flex: 0 0 50%;
    order: 3;
    background: linear-gradient(to bottom, rgba(255, 183, 29, 0) 0%, rgba(255, 183, 29, .9) 65%, rgba(255, 183, 29, 1) 100%);
}

It doesn't make much sense but I've gathered all properties in one place. On neither of my machines I don't do any additional configuration to the extension. I use it as it is right after installation.

As for my files, they are simple CSS files. No post-processors, no webpack or anything like that.

Before updating to version 3.0.1 running autoprefixer on the CSS mentioned above gave me this result:

.test {
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
            flex-flow: row wrap;
    -webkit-box-pack: center;
            justify-content: center;
    -webkit-box-align: center;
            align-items: center;
    -webkit-box-flex: 0;
            flex: 0 0 50%;
    -webkit-box-ordinal-group: 4;
            order: 3;
    background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 183, 29, 0)), color-stop(65%, rgba(255, 183, 29, .9)), to(rgba(255, 183, 29, 1)));
    background: linear-gradient(to bottom, rgba(255, 183, 29, 0) 0%, rgba(255, 183, 29, .9) 65%, rgba(255, 183, 29, 1) 100%);
}

On version 3.0.1 running the autoprefixer doesn't add any prefixes and does no changes to the styles. They are left as in the first example.

If this is of any help, I'm running Windows 10 with updated VS Code.

from vscode-autoprefixer.

mrmlnc avatar mrmlnc commented on September 21, 2024

Thanks for the issue!

Do you have a problem when the option is enabled?

from vscode-autoprefixer.

ddawdler avatar ddawdler commented on September 21, 2024

Thank you for the quick reply!

I've enabled autoprefixer.findExternalAutoprefixer and the output gives me this:

[Autoprefixer]
Error: Failed to load autoprefixer library. Please install autoprefixer in your workspace folder using **npm install autoprefixer** or globally using **npm install -g autoprefixer** and then run command again.
	at c:\Users\ddawdler\.vscode\extensions\mrmlnc.vscode-autoprefixer-3.0.1\out\extension.js:2:1575513

I tried installing an autoprefixer globally using npm install -g autoprefixer but the issue persists.

from vscode-autoprefixer.

mrmlnc avatar mrmlnc commented on September 21, 2024

Looks like a bug. I'll try to reproduce this on my machine. Most likely related to 7b09fa2

from vscode-autoprefixer.

mrmlnc avatar mrmlnc commented on September 21, 2024

@ddawdler, Can you share your configuration of the plugin and file that has the problem?

from vscode-autoprefixer.

brunoaugusto avatar brunoaugusto commented on September 21, 2024

I'm having the same issue with the same error. Is it possible to downgrade the extension on my machine?

from vscode-autoprefixer.

MarkLopresto avatar MarkLopresto commented on September 21, 2024

I am having the same issue. The downgrade suggested above — to 3.0.0 — was able to restore the functionality before the upgrade.

macOS: 10.15.4
VS Code: Version: 1.45.0

from vscode-autoprefixer.

fac42 avatar fac42 commented on September 21, 2024

Is it possible to use just "defaults" for the value in the "browsers" property? Or does the extension only work properly if you specify what browsers to target?

from vscode-autoprefixer.

bostiq avatar bostiq commented on September 21, 2024

I'm gonna sound like a total noob and say I still have no idea how to fix this:

what settings do I need to change? I don't have browserlist settings.

in VS I tried to put the settings above in autoprefixer.option of settings.json and/or in my workspace.json ...no luck

from vscode-autoprefixer.

ddawdler avatar ddawdler commented on September 21, 2024

@fac42 @bostiq

I haven't had luck with not setting anything in the settings.json. I suggest checking this page for help on how to set up the extension.

Here's an example of the settings I use:

"autoprefixer.options": {
    
        "browsers": [
            "last 4 versions",
            "ie >= 9",
            "> 5%"
        ]
    }

from vscode-autoprefixer.

bostiq avatar bostiq commented on September 21, 2024

@ddawdler

hey, thank you... for whatever reason it worked this time.

if I can bother you more I have a question: I work solo so I don't have a lot of work-flow proper practices set up for me... I had to come up with my own, and they are probably wrong - I find compiling from sass and then autoprefixing, then beautifying and then minifying ... quite tedious... have you got a suggestion to streamlining/automatise these processes?

sorry if it sound like a dumb question... and I realise this is not the platform.

from vscode-autoprefixer.

StarlexDiax avatar StarlexDiax commented on September 21, 2024

I'm having the same issue with the same error. Is it possible to downgrade the extension on my machine?

Sure! To install the previous version, go to your extensions, click the little cog wheel icon on the Autoprefixer extension and choose "Install Another Version". I installed 3.0.0 and it works great on my machine.

This actually worked, Thank you

from vscode-autoprefixer.

andyzu avatar andyzu commented on September 21, 2024

[Autoprefixer]
Error: Failed to load autoprefixer library. Please install autoprefixer in your workspace folder using npm install autoprefixer or globally using npm install -g autoprefixer and then run command again.
at /Users/andyzu/.vscode/extensions/mrmlnc.vscode-autoprefixer-3.0.1/out/extension.js:2:1575513

"autoprefixer.options": {
"browsers": [
"last 3 versions",
"> 5%",
"ie >= 8",
"firefox >= 20",
"chrome >= 35",
"Opera >= 11.5",
"safari >= 8",
"edge >= 90",
"and_uc >= 12",
"and_qq >= 10",
"iOS >= 6",
"android >= 4.4",
]
},

1、npm i -D autoprefixer
2、npm i -g autoprefixer
3、npm i -g postcss
4、npm i -g postcss-loader
5、npm i -g node-sass postcss-cli clean-css-cli browserslist

The error is still there, how can I fix it? THANKS!
I also chose to downgrade to 3.0.0, prompting me:
[object Object] is not a PostCSS plugin。

from vscode-autoprefixer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.