Function ___netlify-odb-handler.zip exceeds 52mb supported

Hello everyone. I am working with Nextjs and a headless CMS I enable ISR and the .zip file used by the ___netlify-odb-handler.zip function is 67 MB in size and the maximum supported is 52.4 MB.

These are some of the optimizations made but the .zip does not decrease in size:

  • Remove the local Cypressjs configuration and its dependencies
  • Remove storybook dependencies
  • Use Dynamic Import to minimize chunk files

Build: Netlify App

Thanks for your help

Hey there, @Manuel_Ortega :wave:

Thanks so much for reaching out, and welcome to the Netlify Forums!

Can you please share what you have inside your ISR dependency route? Understanding more about this will help us work towards a solution.

Hi Hillary, thanks for you answer. This is the excerpt from our getStaticProps and getStaticPaths functions

The problem is that this custom_type of Prismic (CMS) has many pages created

export async function getStaticProps({
    locale,
    locales,
    previewData,
    params: { uid },
  }) {
    try {
      const client = createClient({ previewData });
      const page = await client.getByUID("page", uid, { lang: locale }));
      const menu = await client.getSingle("top_menu", { lang: locale });
      const footer = await client.getSingle("footer", { lang: locale });
      
      return {
        props: {
          page,
          menu,
          footer,
          locales: locales || {},
          locale: locale || {},
          uid,
        },
        revalidate: 60,
      }; 
    } catch (error) {
      return {
        notFound: true,
        props: {
          error: JSON.stringify({ ...error, uid }),
          uid,
          locale,
        },
      };
    }
  }
  
  export async function getStaticPaths(context) {
    const client = createClient({ context });
    const pages = await client.getAllByType("page", { lang: "*", pageSize: 60 });
    const allPages = [...pages];
    return {
      paths: allPages
        .filter((page) => page.uid !== "404")
        .map((page) => prismicH.asLink(page, linkResolver)),
      fallback: true,
    };
  }

Hmmm… this doesn’t give us a lot to go with. Could you try to reduce the number of dependencies being used in your ISR-backed pages?

hey, I already removed the unnecessary dependencies. Here you can see the file where I have the problem with the ISR TestPublicSite_Nextjs/[uid].js at main · mortegac/TestPublicSite_Nextjs · GitHub

@hrishikesh @hillary In netlify do you have this enabled? swc-minify-enabled | Next.js

We have 200mb in dependencies that we can’t remove

  • next@12.3.1 (11 deps, 67.66mb, 3052 files)
  • mapbox-gl@2.10.0 (28 deps, 40.93mb, 914 files)
  • react-lottie@1.2.3 (4 deps, 16.23mb, 2042 files)
  • styled-components@5.3.6 (52 deps, 13.18mb, 2242 files)
  • @reduxjs/toolkit@1.8.6 (6 deps, 12.77mb, 602 files)
  • @babel/core@7.19.3 (57 deps, 10.09mb, 1657 files)
  • @mapbox/mapbox-gl-geocoder@5.0.1 (115 deps, 9.69mb, 1206 files)
  • moment-timezone@0.5.37 (1 dep, 7.53mb, 558 files)
  • @prismicio/slice-simulator-react@0.2.2 (6 deps, 5.05mb, 825 files)
  • swiper@8.4.3 (2 deps, 4.74mb, 313 files)
  • react-dom@18.2.0 (3 deps, 4.4mb, 62 files)
  • fp-ts@2.12.3 (4.04mb, 614 files)
  • @types/node@18.8.4 (3.37mb, 125 files)
  • framer-motion@7.5.3 (13 deps, 2.92mb, 1080 files)
  • prismic-reactjs@1.3.4 (9 deps, 2.3mb, 804 files)
  • react-redux@8.0.4 (12 deps, 1.97mb, 410 files)
  • @prismicio/next@0.1.6 (8 deps, 1.89mb, 299 files)
  • axios@1.1.2 (8 deps, 1.6mb, 141 files)
  • @prismicio/react@2.5.0 (6 deps, 1.44mb, 250 files)
  • @prismicio/client@6.7.1 (5 deps, 1.31mb, 182 files)
  • @prismicio/helpers@2.3.5 (4 deps, 913.75kb, 149 files)
  • emailjs-com@3.2.0 (115.31kb, 29 files)
  • io-ts@2.2.19 (450.95kb, 83 files)
  • io-ts-types@0.5.18 (127.05kb, 158 files)
  • iso-country-currency@0.6.0 (26.5kb, 11 files)
  • jwt-decode@3.1.2 (29.03kb, 11 files)
  • monocle-ts@2.3.13 (359.71kb, 103 files)
  • newtype-ts@0.3.5 (34.02kb, 60 files)
  • next-redux-wrapper@8.0.0 (62.52kb, 10 files)
  • next-sitemap@3.1.24 (2 deps, 340.57kb, 135 files)
  • react@18.2.0 (2 deps, 329.09kb, 33 files)
  • react-helmet@6.1.0 (7 deps, 276.15kb, 59 files)
  • react-hook-form@7.37.0 (778.92kb, 223 files)
  • react-is@18.2.0 (23.45kb, 8 files)
  • redux@4.2.0 (2 deps, 413.53kb, 223 files)
  • redux-thunk@2.4.1 (31.32kb, 12 files)
  • sanitize-html@2.7.2 (14 deps, 866.98kb, 242 files)
  • redux-devtools-extension@2.13.9 (13.28kb, 12 files)
  • redux-logger@4.0.0 (1 dep, 161.14kb, 31 files)

Hey there, @Manuel_Ortega :wave:

Thanks for your patience here. It looks like you are working in the helpdesk with our Support Engineers. Let’s continue the conversation there. Thanks!

1 Like