Comments (12)
I just wanted to chime in here.
I am using a self hosted drone.io and cannot get the build to succeed, however if i run it on my laptop it fails every other time it's run.
What's even stranger is even with debug set to true in my env.json and setting SLS_DEBUG to true, i get inconsistent debug messages.
To improve my odds of deployment i have broken my builds into 2 steps.
# First we create a package, I modified my angular.json to have this run target.
npx ng run api:package
# Next i run the deploy on the built asset
SLS_DEBUG=true npx serverless deploy --package dist/apps/api/.serverless/ --config apps/api/serverless.yml
The line in my angular.json file is as follows
"package": {
"builder": "@flowaccount/nx-serverless:sls",
"options": {
"command": "package",
"buildTarget": "api:build:production",
"config": "apps/api/serverless.prod.yml",
"location": "dist/apps/api",
"package": "dist/apps/api"
}
},
This is placed just below the "serve" option in my config for the api "project".
I had to install YARN for the sole purpose of even getting the builds to work due to the dependency tree shaking that this tries to do.
I really like this project, I just wish the builds were more reliable, instead of having to run the package command 2-4 times before I can run a deploy.
I have an other project I plan on using nx-serverless on, I'm planning on spending more time looking into the cause of the build issues as it prevents me from being able to do an automated deploy from my CI/CD system.
from nx-plugins.
You may have a workspace.json file that's similar to the angular.json file, basically what I added as a run target for the nx cli that does the packaging.
from nx-plugins.
@Destreyf i have been facing similar issues after scaling. So i am in fix for that, but i am going to release v0.5.3 in a few days and it will fix the npm
issue. You will be able to use npm. For the packaging issue there might be several causes which i am investigating. But it might be release as v1.0.0
in a month time.
from nx-plugins.
Is this for angular universal app?
from nx-plugins.
@wickstargazer It's for serverless framework plugin.
from nx-plugins.
To further clarify, I do not have issues with SLS_DEBUG when doing other serverless tasks, only tasks related to nx-serverless.
from nx-plugins.
@Destreyf Same, with nx-serverless, It's stopping for me at packaging
step, with no error, where using sls commands standalone, the deployment processes just fine.
from nx-plugins.
@dbrrt Can you add the build config to your angular.json file and try running the following command:
SLS_DEBUG=true npx ng run api:package
Does it show any messages? I do get past packaging, albeit inconsistently.
from nx-plugins.
@Destreyf I'm not using angular.json, will try in the package.json, are you able to package the lambda with the plugin?
from nx-plugins.
Makes sense, I'll try that.
from nx-plugins.
Hi i think the above problem is broken down into two issues?
- Being the sls documentation is not clear
- The npm doesn't work.
Am i right? @Destreyf I am fixing the npm and will add some documentations you suggested into the readme somewhere.
Thankz
from nx-plugins.
@wickstargazer I don't know if there's been releases since my last message, the project I used this on has been on hold, I am actually circling back to it this week.
At the time of my message, the real issue was the deploy portion of the SLS command wasn't working consistently, this was actually an issue with the Package step, so I could run the package command multiple times until it succeeded (I had to have yarn installed for it to even work at all) and then once it succeeded, because I broke the deploy into two steps, I could successfully deploy.
This was/is particularly frustrating if you're trying to use a CI/CD system, because it always fails on the first attempt no matter what, which CI/CD systems are blank slates each run, essentially making it impossible to automate deployments.
from nx-plugins.
Related Issues (20)
- [BUG] Cannot create new api HOT 1
- [BUG] Cannot find module '@nrwl/workspace/src/utilities/run-webpack' HOT 1
- [BUG] Schematic "init" cannot resolve the factory. HOT 3
- [BUG] nx-serverless: Property 'port' does not match the schema. '7777' should be a 'number'. HOT 1
- [BUG] When using npm as packager, pacakgelist is not properly computed resulting in "*" for all package versions HOT 2
- [FEAT] Webpack stats.json support HOT 4
- [BUG] NX 13 and Webpack5 Support HOT 10
- Configuration error at 'useDotenv': should be equal to constant HOT 2
- [BUG] After creating monorepo blank workspace not able to create api HOT 3
- [FEAT] Nx-Serverless | option to exclude ALL dependencies from build HOT 1
- Cannot destructure property 'name' of 'node' as it is undefined. - @flowaccount/scully-plugin-angular-delay
- Support newer Serverless framework
- [BUG] Not able to run or build the freshly scaffolded project HOT 3
- [FEAT] Build functions individually HOT 9
- [BUG] Zip file resolution error when deploying a single artifact HOT 18
- Allow for a serverless.ts file HOT 8
- [BUG] External dependencies are unavailable after deploying HOT 5
- [BUG] Cannot Include Json Schema in serverless.yml HOT 6
- [BUG] Runtime.ImportModuleError in every Lambda function after deploying new project HOT 2
- [BUG] Missing compat.ts for sls executor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nx-plugins.