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
593cec11
Unverified
Commit
593cec11
authored
Sep 23, 2026
by
Niklas Mischkulnig
Committed by
GitHub
Sep 23, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: fix "ModuleId not found for ident" regression (#99090)
Regression from #98617 Closes #99082
parent
9806642f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
0 deletions
+42
-0
export.rs
.../crates/turbopack-ecmascript/src/references/esm/export.rs
+10
-0
execution.rs
turbopack/crates/turbopack-tests/tests/execution.rs
+12
-0
a.js
...rbopack/exports/dynamic-import-unused-reexport/input/a.js
+4
-0
a.js
...opack/exports/dynamic-import-unused-reexport/input/b/a.js
+3
-0
b.js
...opack/exports/dynamic-import-unused-reexport/input/b/b.js
+3
-0
index.js
...k/exports/dynamic-import-unused-reexport/input/b/index.js
+2
-0
index.js
...ack/exports/dynamic-import-unused-reexport/input/index.js
+4
-0
options.json
...opack/exports/dynamic-import-unused-reexport/options.json
+4
-0
No files found.
turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs
View file @
593cec11
...
...
@@ -733,6 +733,16 @@ async fn build_compact_reexports(
let
offset
=
part_references
.len
();
for
(
index
,
reference
)
in
esm_references
.iter
()
.enumerate
()
{
// Unused re-exports are absent from the module ID map and cannot contribute
// an import or a source-order position to the compact registration.
if
chunking_context
.unused_references
()
.contains_key
(
&
ResolvedVc
::
upcast
(
*
reference
))
.await
?
{
continue
;
}
if
let
Some
((
key
,
_
))
=
compact_reference_target
(
ResolvedVc
::
upcast
(
*
reference
),
chunking_context
,
...
...
turbopack/crates/turbopack-tests/tests/execution.rs
View file @
593cec11
...
...
@@ -25,6 +25,7 @@ use turbo_tasks_fs::{
use
turbo_unix_path
::
sys_to_unix
;
use
turbopack
::{
ModuleAssetContext
,
global_module_ids
::
get_global_module_id_strategy
,
module_options
::{
EcmascriptOptionsContext
,
ModuleOptionsContext
,
TypescriptTransformOptions
,
side_effect_free_packages_glob
,
...
...
@@ -287,6 +288,8 @@ struct TestOptions {
minify
:
bool
,
#[serde(default)]
production_chunking
:
bool
,
#[serde(default)]
global_module_ids
:
bool
,
/// Packages that are assumed to be side effect free, unless they declare otherwise in their
/// package.json.
#[serde(default)]
...
...
@@ -317,6 +320,7 @@ impl Default for TestOptions {
infer_module_side_effects
:
default_true
(),
minify
:
false
,
production_chunking
:
false
,
global_module_ids
:
false
,
side_effect_free_packages
:
Vec
::
new
(),
server_relative_root
:
default_true
(),
}
...
...
@@ -603,6 +607,14 @@ async fn run_test_operation(prepared_test: ResolvedVc<PreparedTest>) -> Result<V
None
});
if
options
.global_module_ids
{
builder
=
builder
.module_id_strategy
(
get_global_module_id_strategy
(
module_graph
)
.to_resolved
()
.await
?
,
);
}
if
options
.remove_unused_imports
{
builder
=
builder
.unused_references
(
binding_usage
...
...
turbopack/crates/turbopack-tests/tests/execution/turbopack/exports/dynamic-import-unused-reexport/input/a.js
0 → 100644
View file @
593cec11
export
async
function
a
()
{
const
{
a
}
=
await
import
(
'./b'
)
return
a
()
}
turbopack/crates/turbopack-tests/tests/execution/turbopack/exports/dynamic-import-unused-reexport/input/b/a.js
0 → 100644
View file @
593cec11
export
function
a
()
{
return
'a'
}
turbopack/crates/turbopack-tests/tests/execution/turbopack/exports/dynamic-import-unused-reexport/input/b/b.js
0 → 100644
View file @
593cec11
export
function
b
()
{
return
'b'
}
turbopack/crates/turbopack-tests/tests/execution/turbopack/exports/dynamic-import-unused-reexport/input/b/index.js
0 → 100644
View file @
593cec11
export
{
b
}
from
'./b'
export
{
a
}
from
'./a'
turbopack/crates/turbopack-tests/tests/execution/turbopack/exports/dynamic-import-unused-reexport/input/index.js
0 → 100644
View file @
593cec11
it
(
'bundles a dynamic import through a barrel with an unused re-export'
,
async
()
=>
{
const
{
a
}
=
await
import
(
'./a'
)
expect
(
await
a
()).
toBe
(
'a'
)
})
turbopack/crates/turbopack-tests/tests/execution/turbopack/exports/dynamic-import-unused-reexport/options.json
0 → 100644
View file @
593cec11
{
"productionChunking"
:
true
,
"globalModuleIds"
:
true
}
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