Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

Nothing happens when deploying #455

Closed
katspaugh opened this issue Jun 21, 2020 · 9 comments
Closed

Nothing happens when deploying #455

katspaugh opened this issue Jun 21, 2020 · 9 comments

Comments

@katspaugh
Copy link

katspaugh commented Jun 21, 2020

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.

@danielcondemarin
Copy link
Contributor

@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.

@katspaugh
Copy link
Author

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.

@danielcondemarin
Copy link
Contributor

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.

@katspaugh
Copy link
Author

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.

@danielcondemarin
Copy link
Contributor

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.

Let's close this one for now. I intend to make the serverless trace the default target hopefully soon 👍

@danielcondemarin
Copy link
Contributor

Out of interest, how many server side rendered pages do you have and how long did it take to deploy?

@katspaugh
Copy link
Author

34 pages, 297s.

I'm actually wondering how it managed to condense the 90 MB distribution into a 6.6 MB Lambda. Magic!

@danielcondemarin
Copy link
Contributor

danielcondemarin commented Jun 21, 2020

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 #405

@katspaugh
Copy link
Author

After deleting the .next folder, it took:

33.28 real       123.60 user         7.28 sys

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants