question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PurgeCSS is not enabled because you are in dev mode

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
desaintflorentcommented, Jun 24, 2019

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 ,
 },
1reaction
simonhermanncommented, Jan 18, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt.js - PurgeCSS
PurgeCSS is a tool to remove unused CSS from your project.
Read more >
nuxt-purgecss - npm
Start using nuxt-purgecss in your project by running `npm i nuxt-purgecss`. ... false (Disabled during nuxt dev , enabled otherwise).
Read more >
nuxt-purgecss with mdb-vue not working in production
With my current working nuxt.config.js(see below). I test in dev mode "npm run dev" and css is not purged(what I want). then I...
Read more >
The build Property - Nuxt
Nuxt lets you customize the webpack configuration for building your web application as you want.
Read more >
Optimizing CSS with PurgeCSS | Warren Lee
When you are ready go ahead and install the nuxt purgecss module to your nuxt app. ... or `false` when in dev/debug mode...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found