Fix for largePageDataBytes option not working in next.config.js

Hello!
Do you know how to fix this error?
“Warning: data for page “/[[…catchall]]” (path “…”) is 6.58 MB which exceeds the threshold of 128 kB, this amount of data can reduce performance.
See more info here: https://nextjs.org/docs/messages/large-page-data
[ERROR] [1708002714005] LAMBDA_RUNTIME Failed to post handler success response. Http response code: 413.”

largePageDataBytes option is not working
next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  // Turn off React StrictMode for now, as react-aria (used by Plasmic)
  // has some troubles with it. See
  // <https://github.com/adobe/react-spectrum/labels/strict%20mode>
  reactStrictMode: false,
  experimental: {
    largePageDataBytes: 128 * 10000000000,
  }
};

module.exports = nextConfig;

Please see https://docs.plasmic.app/learn/page-performance/#why-is-my-pageprops-size-so-large

@jason
I have pages where payload is much bigger than 128kb but they don’t crash the app
But one specific page not opening and I see 500 error
BTW, all is working locally but not on Vercel

in your initPlasmicLoader() call, can you try adding this option:

export const PLASMIC = initPlasmicLoader({
  ...
  deferChunks: true
});

@chungwu Got an error

@pure_whale ~sorry I think you can try using deferChunksByDefault instead. deferChunks is for fetchComponentData.~

See below for correct advice

@jason Like this?

And make sure you’ve updated @plasmicapp/loader-nextjs to the latest version!

@jason I am using latest version which is 1.0.361
Is it okay that TypeScript says that such option does not exist?

Ah sorry my bad, gave you the wrong info.

Instead of changing initPlasmicLoader, please change your fetchComponentData call. Add a second argument with deferChunks: true, like this:

const plasmicData = await PLASMIC.fetchComponentData('COMPONENT_OR_PAGEROUTE', { deferChunks: true });

@jason I am getting error with this option