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
e9127b52
Commit
e9127b52
authored
Aug 07, 2025
by
Niklas Mischkulnig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always check for duplicate modules
parent
7eb53237
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
mod.rs
turbopack/crates/turbopack-core/src/module_graph/mod.rs
+19
-20
No files found.
turbopack/crates/turbopack-core/src/module_graph/mod.rs
View file @
e9127b52
...
@@ -347,28 +347,27 @@ impl SingleModuleGraph {
...
@@ -347,28 +347,27 @@ impl SingleModuleGraph {
#[cfg(debug_assertions)]
#[cfg(debug_assertions)]
{
{
use
once_cell
::
sync
::
Lazy
;
// use once_cell::sync::Lazy;
// // TODO(PACK-4578): This is temporary while the last issues are being addressed.
// TODO(PACK-4578): This is temporary while the last issues are being addressed.
// static CHECK_FOR_DUPLICATE_MODULES: Lazy<bool> = Lazy::new(|| {
static
CHECK_FOR_DUPLICATE_MODULES
:
Lazy
<
bool
>
=
Lazy
::
new
(||
{
// match std::env::var_os("TURBOPACK_TEMP_DISABLE_DUPLICATE_MODULES_CHECK") {
match
std
::
env
::
var_os
(
"TURBOPACK_TEMP_DISABLE_DUPLICATE_MODULES_CHECK"
)
{
// Some(v) => v != "1" && v != "true",
Some
(
v
)
=>
v
!=
"1"
&&
v
!=
"true"
,
// None => true,
None
=>
true
,
// }
}
// });
});
// if *CHECK_FOR_DUPLICATE_MODULES {
if
*
CHECK_FOR_DUPLICATE_MODULES
{
let
mut
duplicates
=
Vec
::
new
();
let
mut
duplicates
=
Vec
::
new
();
let
mut
set
=
FxHashSet
::
default
();
let
mut
set
=
FxHashSet
::
default
();
for
&
module
in
modules
.keys
()
{
for
&
module
in
modules
.keys
()
{
let
ident
=
module
.ident
()
.to_string
()
.await
?
;
let
ident
=
module
.ident
()
.to_string
()
.await
?
;
if
!
set
.insert
(
ident
.clone
())
{
if
!
set
.insert
(
ident
.clone
())
{
duplicates
.push
(
ident
)
duplicates
.push
(
ident
)
}
}
if
!
duplicates
.is_empty
()
{
panic!
(
"Duplicate module idents in graph: {duplicates:#?}"
);
}
}
}
}
if
!
duplicates
.is_empty
()
{
panic!
(
"Duplicate module idents in graph: {duplicates:#?}"
);
}
// }
}
}
let
graph
=
SingleModuleGraph
{
let
graph
=
SingleModuleGraph
{
...
...
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