- Published on
Next.js - A fix for the 'Serializing big strings...' warning
Noticed this warning in the next run dev
build output lately, seems to come with a longer build time too:
[webpack.cache.PackFileCacheStrategy]
Serializing big strings (242kiB) impacts deserialization performance
(consider using Buffer instead and decode when needed)
Solution: add this to your Next.js config file:
next.config.ts
webpack: (config: { cache: { type: string } }) => {
config.cache = {
type: "memory",
};
return config;
},