Open Nakroma opened 1 year ago
Unfortunately, we cannot exceed Vercel's size limit. However, we can reduce the size of our bundles by moving some dependencies from 'dependencies' to 'devDependencies.' When we build server-side rendering (SSR), most of the code from third-party libraries will be added to the build file. Therefore, you can move most of the libraries to 'devDependencies,' and then test locally. If it works, you can proceed with redeployment.
@dongwa thats the thing, locally the build plus dependencies is ~80MB, nowhere near the size limit.
@dongwa thats the thing, locally the build plus dependencies is ~80MB, nowhere near the size limit.
We only use npm i --production
during deployment, and I'm not sure why it's causing a 250MB error. I remember the size limit being 50MB, as mentioned in this link: https://github.com/dongwa/vercel-quasar/issues/4. So, I suggest you further reduce the build size, as I mentioned earlier.
I recommend that you take a look at this article : https://dev.to/patzick/why-dependencies-matter-deploy-your-nuxt-ssr-universal-app-to-vercel-now-4ndp which mentions some methods that are equally applicable to Quasar.
What you need to do is initially modify your src-ssr
by not returning the ssrhandler. Instead, set up a Node.js server using 'listen', like:
export async function listen ({ app, port, isReady, ssrHandler }) {
await isReady()
return await app.listen(port, () => {
if (process.env.PROD) {
console.log('Server listening at port ' + port)
}
})
}
then package your project. In the 'dist' directory, gradually remove unused dependencies until you find the smallest dependency list that can run your project. Afterward, revert your changes to src-ssr
and attempt a redeployment.
Hey, first of all thanks for making this! I'm currently trying to deploy my quasar project with this, however I get stuck in the build step:
which is strange, since when I build the project locally with
quasar build -m ssr && cd dist/ssr && npm i
it comes out at about 80MB. Maybe this is because its installing the entire projects devDependencies in the beginning? But I don't know a lot about the Vercel deploy process.