Skip to content
This repository was archived by the owner on Feb 1, 2020. It is now read-only.

Cannot read property 'extract' of undefined #48

Closed
DiederikvandenB opened this issue Sep 12, 2018 · 1 comment
Closed

Cannot read property 'extract' of undefined #48

DiederikvandenB opened this issue Sep 12, 2018 · 1 comment

Comments

@DiederikvandenB
Copy link

Hi,

Thank you for this package. Everything is working perfectly in development environment (without PurgeCSS). However, with this configuration, the plugin throws an error:

    at Purgecss.extractSelectors (/Users/Diederik/Sites/3_CUSTOMERS/5_ONBOARD/node_modules/purgecss/lib/purgecss.js:713:43)
    at Purgecss.extractFileSelector (/Users/Diederik/Sites/3_CUSTOMERS/5_ONBOARD/node_modules/purgecss/lib/purgecss.js:647:112)
    at Purgecss.purge (/Users/Diederik/Sites/3_CUSTOMERS/5_ONBOARD/node_modules/purgecss/lib/purgecss.js:409:41)
    at /Users/Diederik/Sites/3_CUSTOMERS/5_ONBOARD/node_modules/purgecss-webpack-plugin/lib/purgecss-webpack-plugin.js:262:79
    at Array.forEach (<anonymous>)
    at /Users/Diederik/Sites/3_CUSTOMERS/5_ONBOARD/node_modules/purgecss-webpack-plugin/lib/purgecss-webpack-plugin.js:231:23
    at Array.forEach (<anonymous>)
   [...]

Whenever I remove these lines, the build process succeeds, but too much CSS gets removed. Hence the implementation of the extractor class.

Any ideas?

@jsnanigans
Copy link
Collaborator

Hi, sorry for the late response.
could you check what the output of the glob.sync is at https://gist.github.com/DiederikvandenB/588b8e01f5931a99757cfc761239cfe6#file-webpack-prod-js-L24-L27 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants