Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

David Klotz
David Klotz
18,527 Points

sublime text + Autoprefixer

I'm trying to use Autoprefixer with sublime text 2 and I get a message "Autoprefixer global name 'Json' is not defined".

Does anyone know what this means and how to fix it? Thanks in advance to anyone that can offer help!

2 Answers

Kate Hrycak
Kate Hrycak
5,542 Points

Hey David, Looks like there was an outstanding issue for Autoprefixer that was resolved around the same time you posted this. For more info: https://github.com/sindresorhus/sublime-autoprefixer/issues/42

Cheers, Katie

David Klotz
David Klotz
18,527 Points

Kate thanks for your response and link! Someone who isn't a treehouse member came across my post and shared the following which worked as well so I thought I would go ahead and post it too.

  1. In Sublime Text 2, go to Preferences > Browse Packages...
  2. In the "Autoprefixer" folder, open up the file "Autoprefixer.py."
  3. Before the first line of the file, add the line import json. (it's giving you the error because it doesn't know how to do json operations yet)

And that's it! You should be able to do Ctrl/Cmd+Shift+P, type "Autoprefixer", and press enter on a CSS file and it should prefix it.