nuxt-purgecss icon indicating copy to clipboard operation
nuxt-purgecss copied to clipboard

TypeError: Class constructor extractor cannot be invoked without 'new'

Open asennoussi opened this issue 5 years ago • 8 comments

I'm trying to build and run. My config:

buildModules: [
    'nuxt-purgecss',
...
],
  build: {
    // analyze: true,
    crossorigin: true,
    extractCSS: true
  }

Full error:

 FATAL  Class constructor extractor cannot be invoked without 'new'                        06:19:49

  at m (node_modules/purgecss/lib/purgecss.js:1:3149)
  at x.extractSelectorsFromFiles (node_modules/purgecss/lib/purgecss.js:1:5172)
  at async x.purge (node_modules/purgecss/lib/purgecss.js:1:7663)
  at async module.exports.runPluginHook (node_modules/purgecss-webpack-plugin/lib/purgecss-webpack-plugin.js:1:1968)

Help?

asennoussi avatar May 15 '20 02:05 asennoussi

Having the exact same issue.

urbgimtam avatar May 15 '20 09:05 urbgimtam

Which package version are you using?

TheAlexLichter avatar May 15 '20 10:05 TheAlexLichter

2

asennoussi avatar May 15 '20 10:05 asennoussi

Any changes to the purgecss module config?

TheAlexLichter avatar May 15 '20 11:05 TheAlexLichter

I used exactly the config shown on the docs.

On Fri, May 15, 2020 at 3:40 PM Alexander Lichter [email protected] wrote:

Any changes to the purgecss module config?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Developmint/nuxt-purgecss/issues/89#issuecomment-629187702, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNKBZPC7NOM3ZWNMUOUID3RRUS2VANCNFSM4NBGFOBQ .

-- Sennoussi Aymane

asennoussi avatar May 15 '20 11:05 asennoussi

Very weird. Tests are passing, so that shouldn't happen. Could you spin up a minimal example repo?

TheAlexLichter avatar May 15 '20 17:05 TheAlexLichter

Having the exact same issue.

Solved it by deleting the whole node_modules directory and reinstalling - I'm using npm. Sorry for the trouble (although I'm pretty sure I've done that previously).

urbgimtam avatar May 20 '20 19:05 urbgimtam

@urbgimtam You might have not deleted your package-lock.json along with node_modules.

I ran into same issue and i deleted my node_modules multiple times but got same error but when i deleted node_modules and package-lock.json then it got resolved.

MUMUKSHMEGHWAL avatar Sep 03 '20 08:09 MUMUKSHMEGHWAL

stale

TheAlexLichter avatar Sep 30 '22 11:09 TheAlexLichter

Doesn't work :(

padcom avatar Jan 20 '23 18:01 padcom

@padcom Please raise a new issue then with more info :)

TheAlexLichter avatar Jan 20 '23 19:01 TheAlexLichter