Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleteOutputPath option should delete the contents and not the directory itself #10856

Closed
sarveshraj opened this issue Jun 22, 2022 · 5 comments
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx stale type: bug

Comments

@sarveshraj
Copy link

sarveshraj commented Jun 22, 2022

Current Behavior

@nrwl/node:webpack executor deletes the output folder before execution. This is due to deleteOutputPath option being set to true by default.

Any target using @nrwl/workspace:run-commands executor with the cwd option set to the output path and one of the commands set to the target using @nrwl/node:webpack executor fails. The failure is because @nrwl/workspace:run-commands tries to run commands in a deleted folder.

Expected Behavior

I am proposing that the deleteOutputPath option delete the contents of the output folder and not the folder itself.

Steps to Reproduce

Reproduced in nrwl/nx-examples#207
Steps mentioned in the PR itself

Failure Logs

Environment

 >  NX   Report complete - copy this into the issue template

   Node : 14.18.1
   OS   : darwin x64
   yarn : 1.22.19
   
   nx : 14.3.1
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.3.1
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.3.1
   @nrwl/eslint-plugin-nx : 14.3.1
   @nrwl/express : Not Found
   @nrwl/jest : 14.3.1
   @nrwl/js : 14.3.1
   @nrwl/linter : 14.3.1
   @nrwl/nest : Not Found
   @nrwl/next : 14.3.1
   @nrwl/node : 14.3.1
   @nrwl/nx-cloud : 14.1.0
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 14.3.1
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.3.1
   @nrwl/web : 14.3.1
   @nrwl/workspace : 14.3.1
   typescript : 4.7.3
   ---------------------------------------
   Community plugins:
         @nxext/svelte: 13.0.2
@AgentEnder AgentEnder added the scope: node Issues related to Node, Express, NestJS support for Nx label Jun 22, 2022
@hevans90
Copy link

hevans90 commented Jun 23, 2022

I just tried setting deleteOutputPath to false (as I wanted this behaviour on one of my builds), and it doesn't seem to even work?

https://nx.dev/packages/node/executors/webpack#deleteoutputpath

image

the output path is still deleted when building this project :(

@JGitHub01
Copy link

I can confirm that setting deleteOutputPath to false does not work. The folder is still deleted. I even tried to overwrite webpack output: clean to false:

const {merge} = require('webpack-merge');

module.exports = (config, _) => {
  return merge(config, {
    // overwrite values heres
    output: {
      clean: false,
    },
  });
}

The output folder still gets deleted.

This behavior also causes a problem with docker volume mount on Linux machine. When the folder is deleted, the mounted volume is lost even if the same folder is recreated. It's not an issue on Mac OS.

@kf6kjg
Copy link

kf6kjg commented Jan 12, 2023

Or you get fun failures like > NX EBUSY: resource busy or locked, rmdir '/path/to/outputfolder' - in my case I've got the output folder mounted tmpfs in my Docker dev container.

@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx stale type: bug
Projects
None yet
Development

No branches or pull requests

5 participants