From d24f506e0efb889c279be5793a3d06149fe0831f Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Thu, 4 May 2023 15:30:46 -0400 Subject: [PATCH] Fix serving images referenced from app directory (#49236) ### What? Fixes serving images that are referenced by JS files inside the `/app` directory. ### Why? ### How? The `NextImageContentSource` attempts to fetch the image out of it's inner content source, and before we were only providing it with the `/public` and `/pages` directory's respective sources. Re: https://vercel.slack.com/archives/C046HAU4H7F/p1683220799917649 --- packages/next-swc/crates/next-dev/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/next-swc/crates/next-dev/src/lib.rs b/packages/next-swc/crates/next-dev/src/lib.rs index 579a4b691e..5601c0f75b 100644 --- a/packages/next-swc/crates/next-dev/src/lib.rs +++ b/packages/next-swc/crates/next-dev/src/lib.rs @@ -389,10 +389,7 @@ async fn source( let main_source = main_source.into(); let source_maps = SourceMapContentSourceVc::new(main_source).into(); let source_map_trace = NextSourceMapTraceContentSourceVc::new(main_source).into(); - let img_source = NextImageContentSourceVc::new( - CombinedContentSourceVc::new(vec![static_source, page_source]).into(), - ) - .into(); + let img_source = NextImageContentSourceVc::new(main_source).into(); let router_source = NextRouterContentSourceVc::new( main_source, execution_context,