ngx-builders/netlify-builder

deploy fails if following the tutorial - fix is to add relative paths (relative to the build script)

corysmc opened this issue · 3 comments

Describe the bug
When trying to deploy using the nx plugin, I get an error that says "deployment failed" after investigating the source, and adding some console.logs - the error said the file wasn't present.

To Reproduce
Steps to reproduce the behavior:

  1. Create nx project
  2. Follow tutorial here: https://www.netlify.com/blog/2020/04/21/deploying-nx-monorepos-to-netlify/
  3. enter the outputPath": "dist/apps/your-app-output"
  4. run in the terminal: NETLIFY_TOKEN=your_token nx deploy your-app
  5. it wil fail - without explanation

To Fix
3. 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"

Looks like this issue is resolved now.

I found what caused the issue - it only happens when combining @nxext/stencil:build with @netlify-builder/deploy:deploy if I only run @netlify-builder/deploy:deploy then I have to have the outputPath relative to the script. 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

It works with my react apps - so I'm guessing this is an issue with the @nxext/stencil:build project. I'll file an issue there

Ahh thanks for debugging it 💙