Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
1180a6ec
Unverified
Commit
1180a6ec
authored
Aug 05, 2025
by
Joshua Hannaford
Committed by
GitHub
Aug 05, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(Turbopack): Address duplicated metadata image modules when they are impored (#82367)
parent
ff4f10a5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
70 additions
and
1 deletion
+70
-1
source_asset.rs
crates/next-core/src/next_image/source_asset.rs
+8
-1
apple-icon.png
test/e2e/app-dir/metadata-image-files/app/apple-icon.png
+0
-0
icon.png
test/e2e/app-dir/metadata-image-files/app/icon.png
+0
-0
layout.jsx
test/e2e/app-dir/metadata-image-files/app/layout.jsx
+8
-0
not-metadata-image.png
...e/app-dir/metadata-image-files/app/not-metadata-image.png
+0
-0
opengraph-image.png
.../e2e/app-dir/metadata-image-files/app/opengraph-image.png
+0
-0
page.jsx
test/e2e/app-dir/metadata-image-files/app/page.jsx
+18
-0
twitter-image.png
test/e2e/app-dir/metadata-image-files/app/twitter-image.png
+0
-0
metadata-image-files.test.ts
...app-dir/metadata-image-files/metadata-image-files.test.ts
+18
-0
turbopack-build-tests-manifest.json
test/turbopack-build-tests-manifest.json
+9
-0
turbopack-dev-tests-manifest.json
test/turbopack-dev-tests-manifest.json
+9
-0
No files found.
crates/next-core/src/next_image/source_asset.rs
View file @
1180a6ec
...
@@ -35,9 +35,16 @@ pub struct StructuredImageFileSource {
...
@@ -35,9 +35,16 @@ pub struct StructuredImageFileSource {
impl
Source
for
StructuredImageFileSource
{
impl
Source
for
StructuredImageFileSource
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
fn
ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
let
modifier
=
match
self
.blur_placeholder_mode
{
BlurPlaceholderMode
::
DataUrl
=>
rcstr!
(
"structured image object with data url"
),
BlurPlaceholderMode
::
NextImageUrl
=>
{
rcstr!
(
"structured image object with next image url"
)
}
BlurPlaceholderMode
::
None
=>
rcstr!
(
"structured image object"
),
};
self
.image
self
.image
.ident
()
.ident
()
.with_modifier
(
rcstr!
(
"structured image object"
)
)
.with_modifier
(
modifier
)
.rename_as
(
rcstr!
(
"*.mjs"
))
.rename_as
(
rcstr!
(
"*.mjs"
))
}
}
}
}
...
...
test/e2e/app-dir/metadata-image-files/app/apple-icon.png
0 → 100644
View file @
1180a6ec
15.6 KB
test/e2e/app-dir/metadata-image-files/app/icon.png
0 → 100644
View file @
1180a6ec
6.54 KB
test/e2e/app-dir/metadata-image-files/app/layout.jsx
0 → 100644
View file @
1180a6ec
export
default
function
Layout
({
children
})
{
return
(
<
html
>
<
head
></
head
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
test/e2e/app-dir/metadata-image-files/app/not-metadata-image.png
0 → 100644
View file @
1180a6ec
6.54 KB
test/e2e/app-dir/metadata-image-files/app/opengraph-image.png
0 → 100644
View file @
1180a6ec
928 KB
test/e2e/app-dir/metadata-image-files/app/page.jsx
0 → 100644
View file @
1180a6ec
import
_img
from
'./apple-icon.png'
import
_img2
from
'./icon.png'
import
_img3
from
'./opengraph-image.png'
import
_img4
from
'./twitter-image.png'
import
_img5
from
'./not-metadata-image.png'
import
Image
from
'next/image'
export
default
function
Page
()
{
return
(
<>
<
Image
src=
{
_img
}
placeholder=
"blur"
/>
<
Image
src=
{
_img2
}
placeholder=
"blur"
/>
<
Image
src=
{
_img3
}
placeholder=
"blur"
/>
<
Image
src=
{
_img4
}
placeholder=
"blur"
/>
<
Image
src=
{
_img5
}
placeholder=
"blur"
/>
</>
)
}
test/e2e/app-dir/metadata-image-files/app/twitter-image.png
0 → 100644
View file @
1180a6ec
6.54 KB
test/e2e/app-dir/metadata-image-files/metadata-image-files.test.ts
0 → 100644
View file @
1180a6ec
import
{
nextTestSetup
}
from
'e2e-utils'
describe
(
'app dir - metadata image files'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
})
it
(
'should handle imported metadata images'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
const
images
=
await
browser
.
elementsByCss
(
'img'
)
expect
(
images
.
length
).
toBe
(
5
)
for
(
const
image
of
images
)
{
const
src
=
await
image
.
getAttribute
(
'src'
)
expect
(
src
).
not
.
toContain
(
'undefined'
)
}
})
})
test/turbopack-build-tests-manifest.json
View file @
1180a6ec
...
@@ -3093,6 +3093,15 @@
...
@@ -3093,6 +3093,15 @@
"flakey"
:
[],
"flakey"
:
[],
"runtimeError"
:
false
"runtimeError"
:
false
},
},
"test/e2e/app-dir/metadata-image-files/metadata-image-files.test.ts"
:
{
"passed"
:
[
"app dir - metadata image files should handle imported metadata images"
],
"failed"
:
[],
"pending"
:
[],
"flakey"
:
[],
"runtimeError"
:
false
},
"test/e2e/app-dir/metadata-json-manifest/index.test.ts"
:
{
"test/e2e/app-dir/metadata-json-manifest/index.test.ts"
:
{
"passed"
:
[
"passed"
:
[
"app-dir metadata-json-manifest should support metadata.json manifest"
"app-dir metadata-json-manifest should support metadata.json manifest"
test/turbopack-dev-tests-manifest.json
View file @
1180a6ec
...
@@ -6942,6 +6942,15 @@
...
@@ -6942,6 +6942,15 @@
"flakey"
:
[],
"flakey"
:
[],
"runtimeError"
:
false
"runtimeError"
:
false
},
},
"test/e2e/app-dir/metadata-image-files/metadata-image-files.test.ts"
:
{
"passed"
:
[
"app dir - metadata image files should handle imported metadata images"
],
"failed"
:
[],
"pending"
:
[],
"flakey"
:
[],
"runtimeError"
:
false
},
"test/e2e/app-dir/metadata-json-manifest/index.test.ts"
:
{
"test/e2e/app-dir/metadata-json-manifest/index.test.ts"
:
{
"passed"
:
[
"passed"
:
[
"app-dir metadata-json-manifest should support metadata.json manifest"
"app-dir metadata-json-manifest should support metadata.json manifest"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment