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

Error: EISDIR: illegal operation on a directory #39

Closed
firestar300 opened this issue Aug 4, 2018 · 4 comments
Closed

Error: EISDIR: illegal operation on a directory #39

firestar300 opened this issue Aug 4, 2018 · 4 comments

Comments

@firestar300
Copy link

Hello, I try to install purgecss-webpack-plugin on my stack but I get the following error :

/Volumes/APPLE SD Card/Projets/beapi/beapi-frontend-framework/themes/beapi-frontend-framework/node_modules/purgecss-webpack-plugin/node_modules/purgecss/lib/purgecss.js:674
                        throw _iteratorError5;
                        ^

Error: EISDIR: illegal operation on a directory, read
    at Object.fs.readSync (fs.js:690:18)
    at tryReadSync (fs.js:554:20)
    at Object.fs.readFileSync (fs.js:597:19)
    at Purgecss.extractFileSelector 

You can reproduce the issue by cloning the repo : https://github.com/BeAPI/beapi-frontend-framework/tree/experiment/purgecss

$ npm install
$ npm run build:test

Version of purgecss-webpack-plugin : 1.2.0

@jsnanigans
Copy link
Collaborator

Hey, did you manage to fix the issue? I can't see purgecss-webpack-plugin in your repo

@firestar300
Copy link
Author

Hello @jsnanigans ! Nope, I didn't find a way to fix this issue. What do you mean by "I can't see purgecss-webpack-plugin in your repo" ? I installed the node package as devDependency : https://github.com/BeAPI/beapi-frontend-framework/blob/experiment/purgecss/package.json#L66

@sbdchd
Copy link

sbdchd commented Feb 7, 2019

You likely need to pass {noDir: true} as an option to glob.sync() as glob.sync is matching a dir which the plugin can't operate on.

new PurgecssPlugin({
  paths: glob.sync(`${paths.appSrc}/**/*`)
}),
// becomes
new PurgecssPlugin({
  paths: glob.sync(`${paths.appSrc}/**/*`, { nodir: true })
}),

@biggamejames
Copy link

I ran into this issue as well. Passing nodir worked.

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

5 participants