justjake / monorepo

GNU Affero General Public License v3.0
40 stars 2 forks source link

[notion-api] emoji-datasource-apple module prevents deployment to Vercel due to its size #1

Closed kyori19 closed 2 years ago

kyori19 commented 2 years ago

Thanks for providing very useful module to handle notion API.

After I included @jitl/notion-api@0.1.2 to my Next.js website deployed to Vercel, Vercel refuses to deploy serverless functions due to emoji-datasource-apple package's too large size.

Large Dependencies                                     Uncompressed size  Compressed size
node_modules/emoji-datasource-apple/img                            94 MB            94 MB
node_modules/react-dom/cjs                                       1.02 MB           244 kB
node_modules/katex/dist                                           612 kB           147 kB
node_modules/emoji-datasource-apple/emoji_pretty.json            2.04 MB           104 kB
node_modules/emoji-datasource-apple/emoji.json                   1.22 MB          96.8 kB

All dependencies                                                  102 MB          95.6 MB
Max serverless function size was exceeded for 1 function
Created all serverless functions in: 5.889s
Failed to process build result for "index". Data: {"type":"Prerender"}.
Error: The Serverless Function "index" is 92.91mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size

image

I just need API helpers such as Property type and getPropertyData function. Could you please separate such helpers from CMS part or remove emoji-datasource-apple from deps?


For those who facing the same issue:

Overriding install command on Vercel settings could solve this issue temporary.

yarn install && rm -rf node_modules/emoji-datasource-apple/img

image

justjake commented 2 years ago

Thanks for the issue report. I will mark this as an optional dependency!

justjake commented 2 years ago

This should be fixed as emoji-datasource-apple is now marked an optional dependency!