Was this really introduced into nextjs
Changes to image handling now seem to require to explicitly declare /_next/image in localPatterns. Is it really what version 16 will require to configure by default? That seems very strange decision, considering it can be automated on compiler level
What was motivation behind it and how is it beneficial for average user?
#.
1 messages · Page 1 of 1 (latest)
Hi @abstract wyvern. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
I'm sorry, but the knowledge sources do not contain any information indicating that Next.js version 16 (or any other version) requires you to explicitly declare /_next/image in localPatterns for image handling. The documentation and issues reviewed only describe how to use localPatterns to restrict which local images can be optimized, typically by specifying pathnames like /assets/images/**. There is no mention of a requirement to include /_next/image in localPatterns by default, nor any explanation of such a change or its motivation.
If you have seen this behavior or announcement elsewhere, it is not reflected in the official documentation or GitHub issues provided here. If this is a recent or upcoming change, it has not been documented in the sources available to me. If you need to ensure image optimization works for your assets, you should follow the current documented approach of specifying the relevant pathnames for your images in localPatterns as shown in the examples:
module.exports = {
images: {
localPatterns: [
{
pathname: '/assets/images/**',
search: '',
},
],
},
}
This configuration ensures only images matching the specified pattern are optimized, and there is no mention of needing to include /_next/image itself in these patterns for correct operation Next.js Image Component Configuration.