Closed dohomi closed 5 years ago
The size of lambdas on zeit.co are limited to 50mb. It is not possible to go over this one. If the application you have generates a build greater than this size for a lambda, unfortunately you can't use the platform.
@bluebeel for me it rather seems like a bug. If I deploy without
filenames: {
app: '[name].js',
chunk: '[name].js'
}
the deployment succeeds but the website does not work at all, if I the filenames naming I receive the error of function size while building. This is a demo repo to showcase the setup: https://github.com/dohomi/nuxt-storyblok-demo-now
Could you try with nuxt-start
@dohomi
nuxt
is 60MB installation size
nuxt-start
is only 8MB
@Atinux I tried a lot of things - but nothing worked. The bundle size was raising up to 150 MB - I don't know out of what reason. Besides that you can only use this bundle without any webpack config and you have to use the same common and app names without hashes which makes caching unavailable
I believe this is because webpack in Nuxt will bundle everything as if it's all shared, however, serverless depends on individual entry points. So we need to find a solution for this. I'm talking to @Atinux and the core Nuxt.js team to try and see how we can resolve this!
Thanks @timothyis and @Atinux and sorry @dohomi for the delayed response. I really don't have the time for the moment with my studies and without now dev
, it's a big hard to debug or improved the builder atm.
@Atinux i was wondering if we could have a serverless target build for nuxt like next.js did.
This is in the backlog of Nuxt.js indeed, it's not that simple since it implied vue-server-renderer
refactoring directly. I am also talking to the Vue core team to see how fast we could implement it.
Guys, soo cool you are working on this :-) Happy to help, if you need a hand
@Atinux for a recent client I am working with NextJS and their serverless build. Currently a quite reasonable sized project is ~200Kb lambda size and a the main page index.js ~1.3MB. Not sure how they receive this size though-.. I tried to look for the responsible code making the bundles but currently stuck with too much work.
Update: Nuxt team are working on an official now2 builder. Lambda size should be reasonably small by properly cleaning up node_modules
.
@pi0 great news! Maybe the size could be reduced if some business logic like serverMiddleware could be abonded, in serverless environment I think people would write their own routes for API endpoints. I think ~400ms cold boot is reasonable but will not result in the best pagespeed ranking.
@dohomi Yes. Things like component LRU-cache or serverMiddleware are not good for serverless. We are trying our best to support and optimize for serverless environments as much as possible but for the best SSR performance, standard/non-serverless deployment is recommended.
Hello this package always results in the following now error:
Only the very first build command succeeds. The dependencies are fairly small this should not be the issue. Is there any now command I am overlooking to clean up the size?