Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unzipped size must be smaller - large next project #141

Closed
jschimmoeller opened this issue Sep 12, 2019 · 9 comments · Fixed by #148
Closed

unzipped size must be smaller - large next project #141

jschimmoeller opened this issue Sep 12, 2019 · 9 comments · Fixed by #148

Comments

@jschimmoeller
Copy link

recieved this error when trying to deploy

112s » nextApp » InvalidParameterValueException: Unzipped size must be smaller than 262144000 bytes

@danielcondemarin
Copy link
Contributor

Thanks for reporting!
What’s the size of your .next/serverless/pages directory? Also any chance you can share the repo details? I have an idea that might help here, but would like to find more about how the next app is structured first.

@jschimmoeller
Copy link
Author

jschimmoeller commented Sep 12, 2019

thanks for getting back to me ... my .next/serverless/pages is 255 MB.

my repo is a very standard next.js project but is a private repo. I have 19 pages along with api folder with 22 api files and a few dynamic pages (2 folders and 2 files).

let me know any suggestion you might have.

here is the detail error:
`
error:
InvalidParameterValueException: Unzipped size must be smaller than 262144000 bytes
at Object.extractError (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\protocol\json.js:51:27)
at Request.extractError (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\protocol\rest_json.js:55:8)
at Request.callListeners (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\sequential_executor.js:106:20)
at Request.emit (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\sequential_executor.js:78:10)
at Request.emit (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\request.js:683:14)
at Request.transition (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\request.js:22:10)
at AcceptorStateMachine.runTo (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\state_machine.js:14:12)
at C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\state_machine.js:26:10
at Request. (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\request.js:38:9)
at Request. (C:\Users\james.serverless\components\registry\npm\serverless-next.js@1.0.1\node_modules\serverless-next.js\node_modules\aws-sdk\lib\request.js:685:12) {
message: 'Unzipped size must be smaller than 262144000 bytes',
code: 'InvalidParameterValueException',
time: 2019-09-12T16:57:41.343Z,
requestId: '49552ec9-5182-41b4-bd58-30aeaa1c53d5',
statusCode: 400,
retryable: false,
retryDelay: 80.56967898468841
}

image

111s » nextApp » InvalidParameterValueException: Unzipped size must be smaller than 262144000 bytes`
thanks
James

@jschimmoeller jschimmoeller changed the title large next project unzipped size must be smaller - large next project Sep 13, 2019
@danielcondemarin
Copy link
Contributor

danielcondemarin commented Sep 17, 2019

Sorry for the late reply @jschimmoeller .

Here is my idea to solve this problem:

1 - Create a separate cache behaviour for /api requests.
This allows separating the deployment packages for /api pages and standard pages. API pages would have 50MB zipped up and standard pages another 50MB.
2 - If the above is not enough, we can detect this and create more granular cache behaviours with their own lambda function associations. For example, in your app 2 more cache behaviours could be created for series/ and watching/. Again this frees up some space in the main Lambda allowing for bigger apps.

I'm not very sure about 2. as it adds a lot of complexity to the project but 1. certainly makes a lot of sense. I plan on start implementing 1. very soon, I'll keep you posted.

@jschimmoeller
Copy link
Author

@danielcondemarin

My api directory as it is right now is 90mb. The series and watch folder are dynamic routes which together are only 17mb. The remaining pages are 147mb.

Based on your input above I would need to be able to setup multiple "cache behavior" in order to get around what appears to be the 50MB limit.

thanks
james

@danielcondemarin
Copy link
Contributor

@jschimmoeller Are those numbers after zipping up?

@jschimmoeller
Copy link
Author

@danielcondemarin sorry but no that is just based on the directory /files sizes

i used 7-zip and here are my values:

api folder - 16.6mb zipped
remaining pages - 31.2mb zipped

so based on your original reply it would be under 50mb

thanks
James

@danielcondemarin
Copy link
Contributor

@jschimmoeller Just published 1.2.0-alpha.0 which should address this issue.
I've added the api/* cache behaviour for api pages. Also, fixed an issue where HTML static pages where getting put in the lambda@edge src producing bigger packages unnecessarily.
Let me know how it goes and feel free to re-open if you encounter any problems 👍

@jschimmoeller
Copy link
Author

@danielcondemarin just updated package.json and did a deploy was able to deploy it 👍 I am currently tracking down a 500 :( I hope it is on my end

@danielcondemarin
Copy link
Contributor

@danielcondemarin just updated package.json and did a deploy was able to deploy it 👍 I am currently tracking down a 500 :( I hope it is on my end

Good stuff! Let me know if it isn't :)

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

Successfully merging a pull request may close this issue.

2 participants