Amaimersion / remove-files-webpack-plugin

A plugin for webpack that removes files and folders before and after compilation.

Home Page:https://www.npmjs.com/package/remove-files-webpack-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: EISDIR: illegal operation on a directory, copyfile

MaurizioCasciano opened this issue · comments

Bug Report

Deleting a directory to the trash results in Error: EISDIR: illegal operation on a directory, copyfile

Environment

  • plugin version: 1.4.4
  • system and its version: Ubuntu 20.04.2 LTS
  • webpack version: 3.10.0
  • node version: 14.13.0

Expected Behavior

Directory gets removed and restored without problems

Actual Behavior

Directory gets moved to the trash, but when restoring it results in an error EISDIR

Configuration

new RemovePlugin({
    before: {},
    watch: {},
    after: {
        include: ['./ng-client/'],
        trash: true,
    }
})

Debug Log

remove-files-plugin@1.4.4:
The following items have been moved to the trash:
  folders:
    ng-client/

MergetJsonsWebpackPlugin emit starts...
MergetJsonsWebpackPlugin emit completed...
(node:39878) UnhandledPromiseRejectionWarning: Error: EISDIR: illegal operation on a directory, copyfile '/media/data/WorkSpace/WP-2/ng-client' -> '/home/izio/.local/share/Trash/files/2c41d73d-449f-4cc6-aeec-7358b92702ea'
(node:39878) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)

Additional Information

Hello! Sorry for long awaiting.

Most probably the problem not with plugin itself. I think this problem related to trash tool, which is used by the plugin.

If you still expecting this issue, then try to create issue in "trash" repository.

I'm closing this. Feel free to reopen if you think that this issue related to this project.

I've upgraded project production dependencies to latest versions (at this moment) - c9a2210

Try to upgrade this package to 1.4.5 version and see if this solves your issue.