This is most likely some misconfiguration on my part but I can't figure out what exactly is wrong. Is there a verbose mode?
My serverless.yml:
# serverless.yml
webapp:
component: serverless-next.js
When running serverless, it just displays a timer and nothing happens for 45 min and more:
2756s › webapp › Deploying ...
I see it has created an S3 bucket and uploaded the Next app to it. No Lambdas or CloudFronts were created though.
Some sort of logging and progress reporting would be nice.
Any pointers would be appreciated.
@katspaugh Can you run serverless --debug and paste the output here please. That should give the necessary info to figure out where is going wrong.
Thanks Daniel!
It's created an S3 and IAM roles successfully and seems to be hanging on the lambda creation step:
DEBUG ─ Creating lambda humphj4-msk06u in the us-east-1 region.
Is it supposed to deploy a single lambda for all pages or a lambda for each page? Because I know the entire zipped app is more than 90 MB. Which is bigger than a single lambda can hold.
Is it supposed to deploy a single lambda for all pages or a lambda for each page?
SSR pages to one Lambda, API pages to a separate one.
Check a couple of things,
First that the aws user you are using for deploying has the permissions listed here, especially the lambda creation ones as it seems to be getting stuck there.
If the above is fine, then try setting useServerlessTraceTarget: true in your inputs. This is a new build target I'm working on that should considerably reduce the deployment artefact size.
Awesome, with useServerlessTraceTarget it worked like a charm! Thanks a lot!
Do you want me to leave this issue open? I guess it would be good to show an error when it cannot deploy a lambda.
Awesome, with
useServerlessTraceTargetit worked like a charm! Thanks a lot!
Do you want me to leave this issue open? I guess it would be good to show an error when it cannot deploy a lambda.
Let's close this one for now. I intend to make the serverless trace the default target hopefully soon 👍
Out of interest, how many server side rendered pages do you have and how long did it take to deploy?
34 pages, 297s.
I'm actually wondering how it managed to condense the 90 MB distribution into a 6.6 MB Lambda. Magic!
34 pages, 297s.
Just one more thing if you don't mind, how much time it takes to run next build? I'm trying to figure out how long it took to package the ssr pages and deploy. There are a few optimisations I'm planning to do that should shave off some time.
I'm actually wondering how it managed to condense the 90 MB distribution into a 6.6 MB Lambda. Magic!
Take a look 👀 at https://github.com/danielcondemarin/serverless-next.js/pull/405
After deleting the .next folder, it took:
33.28 real 123.60 user 7.28 sys