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

MDX and edge function size limit #339

Open
sdorra opened this issue Nov 26, 2022 · 2 comments
Open

MDX and edge function size limit #339

sdorra opened this issue Nov 26, 2022 · 2 comments

Comments

@sdorra
Copy link

sdorra commented Nov 26, 2022

I'm using contentlayer with MDX for a blog and it is working pretty well, but recently i would like to use it in a vercel edge function as well. Edge functions have a bundle size limit of 1mb, which is achieved quite quickly with contentlayer and MDX. I've written about the problem and my workaround here. It would be nice if some better solution would be backed into contentlayer.

A few possible solutions come to my mind.

  1. Split the body from the rest of the content and load it on demand with an async function on the entity
  2. Option to create a separate collection of the entity without body
  3. Hooks which makes it easy to write a separate collection without body on every change
@stale
Copy link

stale bot commented Jan 25, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@git-no
Copy link

git-no commented Mar 18, 2023

@sdorra
The maximum size of an Edge Function is (now) 4 MB, maybe Vercel did change the limitations.
Edge Middleware has a 1 MB limitation.

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

No branches or pull requests

3 participants