nuxt / vercel-builder

Vercel Builder for Nuxt
MIT License
645 stars 75 forks source link

Exceeds maximum size limit of 50mb #727

Closed phadaphunk closed 1 year ago

phadaphunk commented 1 year ago

Hi,

Since the latest release (0.23), all deployments are failing with the following message :

image

I rolled back to 0.22.1 and the deployment never goes over 49.99 mb.

Was this limit handled before and this change is expected?

kmukku commented 1 year ago

How did you fixed this @phadaphunk ? I'm having constantly same issues with nuxt2.

phadaphunk commented 1 year ago

@kmukku Didn't really, we switched SSR to false and moved a lot of packages to devDependencies to save space. We might have to move at some point due to the size, but at the moment we still have space to save with other dependencies.

kmukku commented 1 year ago

I was able to make it work with nuxt2 again by locking to version 0.22.1. Hope it will work for you too.

vercel.json

{
    "version": 2,
    "builds": [
        {
            "src": "nuxt.config.js",
            "use": "@nuxtjs/vercel-builder@0.22.1"
        }
    ]
}
phadaphunk commented 1 year ago

@kmukku Thanks for the tip! We did try that, and it did reduce the package size a bit, but we were still a little bit over 😢 It is good to note that the new version does increase the size a bit 👀

Naybnet commented 1 year ago

In SSR mode I also had to rollback to 0.22.1 since the index function went up to 110MB.

phadaphunk commented 1 year ago

Actually, this is still relevant.

lucasfischer commented 1 year ago

Experiencing the same issue since October 28th. Rolling back to 0.22.1 fixes this issue for our project as well.

azpery commented 1 year ago

Hello everybody,

I am facing the same issue today while updating my packages. I'm rolling back to 0.22.1 thanks to @kmukku

went from 18Mb to 156 Mb x)

Bye

MurmeltierS commented 1 year ago

similar problem here

leerob commented 1 year ago

Hey folks, thanks for flagging. We'll work with the team on this 👍

danielroe commented 1 year ago

The issue is the latest version of npm, which has a bug with installing dependencies in a symlink. Previously we pinned to an older version of the vercel build tools and raised the issue. See https://github.com/nuxt/vercel-builder/pull/636 for a description of the problem.

Current workarounds are:

clamarque commented 1 year ago

Hey, any news on this project? I'm still stuck on the deployment of my project :(

danielroe commented 1 year ago

This should be resolved in the latest version of this builder via https://github.com/nuxt/vercel-builder/pull/636

codeofsumit commented 1 year ago

This problem still persists for me. I have the latest release.

Pinning the version to an older version doesn't work either because it apparently requires vercel to use node 14 (but our codebase and vercel project is on node 16).

Any help is appreciated

leerob commented 1 year ago

Hey @codeofsumit, you can still use Node.js 14 on Vercel.

danielroe commented 1 year ago

Sorry to hear you're still experiencing this. Would you open a new issue with a reproduction, so I can look into it? 🙏

codeofsumit commented 1 year ago

@danielroe I have created a reproduction repo. I tried to get closer and closer to our web app setup including package versions, node version, etc.

While I haven't been able to get the exact error (yet), I still get an error and I'm stuck now.

Repo: https://github.com/tresorone/temp-web-app-repro

Error

✖ Nuxt Fatal Error                                                         ││                                                                              ││   Error:                                                                     ││                                                                              ││   Vue packages version mismatch:                                             ││                                                                              ││   - vue@2.6.14                                                               ││   - vue-server-renderer@2.7.14                                               ││                                                                              ││   This may cause things to work incorrectly. Make sure to use the same       ││   version for                                                                ││   both.                                                                      ││                                                                              ││                                                             

Vercel Project Settings:

image image
danielroe commented 1 year ago

(Reopening to track in case this is a regression.)

@codeofsumit The issue is that you have a mismatch in your Vue versions (2.6 vs 2.7). I'm happy to push a fix to your package.json if you share access to the repo with me.

codeofsumit commented 1 year ago

@danielroe done. After your fix, I will continue to attempt deployment and will report back.

codeofsumit commented 1 year ago

@danielroe thanks for the fix. Now we have the issue we were looking for:

Error: The Serverless Function "index" is 82.21mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size

danielroe commented 1 year ago

@codeofsumit Having checked your project and its build output, it doesn't seem like this isa bug with the builder or a regression of the linked issue here. (Just to confirm - you never used the builder successfully, right?)

Rather, your app is just too big when processed with this bundler. You should move many of your dependencies to devDependencies because they are not needed once your app is built. For example, nuxt (which depends on webpack) should be in your devDependencies, as well as any buildModules.

I would highly recommend that if you are using Nuxt 2 you consider Nuxt Bridge, which offers a much smaller output size and handles a lot of these issues.