Giter Club home page Giter Club logo

Comments (7)

ajhool avatar ajhool commented on May 25, 2024 1

@wickstargazer Thank you very much! I will test it out and close this issue on success. I'm in active development on this product right now and am finding that deploy is also failing in a Gitlab CI (lambci/) environment so I will make an issue for that, too.

from nx-plugins.

wickstargazer avatar wickstargazer commented on May 25, 2024 1

@ajhool this bug is fixed in 0.4.5

the schematics is changed from nx generate @flowaccount/nx-serverless:application
to nx generate @flowaccount/nx-serverless:api-serverless

if you think that does not make sense please recommend.

also if you are using on an existing repo, you have to remove the watch:true from the build architect.
Basically, that was the bug.

I will close the issue for now, we can re-open if you find something wrong with the fix

from nx-plugins.

ajhool avatar ajhool commented on May 25, 2024

As far as I can tell, the nx "exclude" flag is also not working correctly, so the workaround that I am currently using in CI is to use the --projects flag rather than the -all flag and to list every project except for the sls project.

# This "exclude" flag does not seem to actually exclude the sls-api:
nx run-many --target=build --all --parallel --exclude=sls-api
# Skips the sls app
nx run-many --target=build --projects=todo,todo-e2e,api,api-interfaces,todo-batch --parallel
# Deploys the sls app (and any other deploy targets)
nx run-many --target=deploy --all --parallel

from nx-plugins.

wickstargazer avatar wickstargazer commented on May 25, 2024

This has been fixed in the latest release :)
Its the watch: true flag that has been defaulted into the build options, for now you can remove it from workspace.json or angular.json

Exciting release is coming up, can deploy angular universal! :D Thank you for showing interest!

Sorry for the late reply ... I will try to be more prompt!

from nx-plugins.

ajhool avatar ajhool commented on May 25, 2024

@wickstargazer thanks for the update. Sorry for not getting back to this issue, I have been tracking down some other issues, most of which were AWS permissions + serverless config. However, it would be really helpful to see serverless verbose output in the terminal but I haven't found a way to do that with nx run-many --target=deploy, any ideas? I can open a new issue for logging if you would like

from nx-plugins.

wickstargazer avatar wickstargazer commented on May 25, 2024

try export SLS_DEBUG=true

from nx-plugins.

ajhool avatar ajhool commented on May 25, 2024

Even with SLS_DEBUG=true, the output of nx run-many --target=deploy --all fails silently

Serverless: Load command param:get
Serverless: Load command param:list
Hash: dcbfaafc7f35681865e0
Built at: 03/15/2020 3:43:52 PM
Entrypoint src/handler = src/handler.js
chunk    {0} src/handler.js (src/handler) 412 bytes [entry] [rendered]
[0] external "tslib" 42 bytes {0} [built]
    [1] 1617ms -> factory:3ms building:1ms = 1621ms
[1] ./apps/sls-api-v2/src/handler.ts 370 bytes {0} [built]
    factory:1278ms building:339ms = 1617ms
Serverless: getting external modules
Serverless: create a package.json with first level dependencies
Serverless: generate lock entry for yarn for dependency graph to work.
Serverless: get the packagelist with dependency graph and depth=2 level
Serverless: re-writing package.json with dependency-graphs
Serverless: WARNING: Could not determine version of module tslib
Serverless: run packager to  install node_modules
Serverless: yarn install v1.21.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 0.55s.

Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Packaging service...


———————————————————————————————————————————————


>  NX   ERROR  Running target "deploy" failed

  Failed projects:
  
  - sls-api-v2
  
  You can isolate the above projects by passing: --only-failed

Whereas a native serverless deploy provides useful information on the failure:

Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Packaging service...
 
  Serverless Error ---------------------------------------
 
  ServerlessError: Missing "handler" property in function "vpc". Please make sure you point to the correct lambda handler. For example: handler.hello. Please check the docs for more info

I will open a new issue for this one.

from nx-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.