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

Created on 29 Jan 2020  路  3Comments  路  Source: FullHuman/purgecss

I just updated @fullhuman/purgecss to the latest version, and experience a weird issue now while using this inside of a nuxt typescript built:

TypeError: Class constructor extractor cannot be invoked without 'new'
    at extractSelectors (/home/simon/Dev/hokify/hokify-frontend/node_modules/purgecss/lib/purgecss.js:1:2358)
    at PurgeCSS.extractSelectorsFromFiles (/home/simon/Dev/hokify/hokify-frontend/node_modules/purgecss/lib/purgecss.js:1:5802)
    at async /home/simon/Dev/hokify/hokify-frontend/node_modules/@fullhuman/postcss-purgecss/lib/postcss-purgecss.js:1:501

Versions:
purgecss 2.0.5
@fullhuman/[email protected]

Most helpful comment

The extractor is now a function that takes the content as an argument.

class Extractor {
    static extract(content) {}
}

changes to

function extractor(content) {}

All 3 comments

The extractor is now a function that takes the content as an argument.

class Extractor {
    static extract(content) {}
}

changes to

function extractor(content) {}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

joneldiablo picture joneldiablo  路  6Comments

crazy4groovy picture crazy4groovy  路  7Comments

ctf0 picture ctf0  路  4Comments

estevanmaito picture estevanmaito  路  9Comments

mikecousins picture mikecousins  路  9Comments