Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PurgeCSS is not enabled because you are in dev mode #33

Closed
MarvinMiles opened this issue Jan 31, 2019 · 6 comments
Closed

PurgeCSS is not enabled because you are in dev mode #33

MarvinMiles opened this issue Jan 31, 2019 · 6 comments
Labels
question Further information is requested

Comments

@MarvinMiles
Copy link

Hey! Thanks for your work

Looks like I missed something.

I am using Tailwind CSS and here is my nuxt config:

modules: [ 'nuxt-purgecss' ],

purgeCSS: {
    mode: 'postcss',
    whitelist: ['html', 'body', 'nuxt-progress', 'is-active']
  },

build: {
    extractCSS: true,
    postcss: {
      plugins: {
        tailwindcss: './tailwind.config.js',
        autoprefixer: {}
      }
    }
...

I got "PurgeCSS is not enabled because you are in dev mode"
regardless yarn dev or yarn build command I am using

What I am doing wrong? Thanks

@manniL
Copy link
Member

manniL commented Jan 31, 2019

Hey 👋

You are welcome!
Can you share your whole nuxt.config.js?

PS: When using extractCSS, you could use the default webpack mode :)

@manniL manniL added the question Further information is requested label Jan 31, 2019
@MarvinMiles
Copy link
Author

MarvinMiles commented Feb 1, 2019

Problem was in "debug: true". Turning it to false solves the issue. Thanks)

@desaintflorent
Copy link

I had the same problem.
i got the "PurgeCSS is not enabled because you are in dev mode" on my remote app using CleverCloud.
Of course I set up DEBUG to true and all env variables to production, but I was always getting an error saying I was in Dev mode.. but I was in production. I think the error message is misleading because it check if (typeof purgeCSS.enabled === 'undefined') but that doesn't mean we are in dev mode right ? I think the problem come from the enabled option with " ({ isDev, isClient }) => (!isDev && isClient) ". It doesn't seem to work anymore. I was getting "undefined" while testing.

For people stuck like me, I ended up setting the enabled option in nuxt.config.js with one of my env variable.

purgeCSS: {
    enabled:  process.env.NODE_ENV == 'production' ? true : false ,
 },

@simonhermann
Copy link

I have the same Problem, but even setting enabled: true does not fix it. On Netlify and local, no debug mode or anything set :(
Can you help @manniL? 👼

@simonhermann
Copy link

I was able to fix the issue by upgrading all dependencies, not sure which one was causing the problem..

@Foddie2
Copy link

Foddie2 commented Oct 30, 2023

After trying all these options still getting the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants