diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 62472d162d519..af8bcd9dcdf7a 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1310,6 +1310,11 @@ export default async function getBaseWebpackConfig( ], }, resourceQuery: { + // Do not apply next-flight-loader to imports generated by the + // next-metadata-image-loader, to avoid generating unnecessary + // and conflicting entries in the flight client entry plugin. + // These are already covered by the next-metadata-route-loader + // entries. not: [ new RegExp(WEBPACK_RESOURCE_QUERIES.metadata), new RegExp(WEBPACK_RESOURCE_QUERIES.metadataImageMeta),