nx-extensions icon indicating copy to clipboard operation
nx-extensions copied to clipboard

Build path isn't passed correctly to another builder calling @nxext/stencil:build

Open corysmc opened this issue 3 years ago • 0 comments

Describe the bug When trying to deploy using this plugin: https://github.com/ngx-builders/netlify-builder, I get an error that says "deployment failed" after investigating the source, the error said the file wasn't present.

To Reproduce

  1. Create nx project
  2. Create stencil/app
  3. Follow tutorial here to add deploy to netlify: https://www.netlify.com/blog/2020/04/21/deploying-nx-monorepos-to-netlify/
  4. Enter the outputPath": "dist/apps/your-app-output"
  5. run in the terminal: NETLIFY_TOKEN=your_token nx deploy your-app
  6. it will build successfully, but fail to deploy

To Fix

  1. enter the outputPath": "../../../dist/apps/your-app-output" - this is relative to the build script in node_modules

Expected behavior I would expect to put the path as explained in the tutorial - relative to my project. outputPath": "dist/apps/your-app-output"

Additional Context Originally posted here: https://github.com/ngx-builders/netlify-builder/issues/119

This bug only happens when combining @nxext/stencil:build with @netlify-builder/deploy:deploy

  1. If I only run @netlify-builder/deploy:deploy then I have to have outputPath": "../../../dist/apps/your-app-output" (location relative to the script?).
  2. If I build first with @nxext/stencil:build then deploy via @netlify-builder/deploy:deploy (with noBuild:true) then the outputPath can be dist/apps/your-app-output and it will work 👍

netlify-builder/deploy:deploy works with my ionic-react apps, which is why I'm filing this issue with the @nxext/stencil:build

corysmc avatar May 04 '21 20:05 corysmc