diff --git a/turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs b/turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs index 24fad70469a3d6..d7062234da9875 100644 --- a/turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs +++ b/turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs @@ -1,9 +1,13 @@ -use anyhow::{bail, Result}; +use anyhow::Result; use turbo_rcstr::RcStr; use turbo_tasks::{FxIndexMap, ResolvedVc, ValueToString, Vc}; +use turbo_tasks_hash::hash_xxh3_hash64; use super::ModuleId; -use crate::ident::AssetIdent; +use crate::{ + ident::AssetIdent, + issue::{module::ModuleIssue, IssueExt, StyledString}, +}; #[turbo_tasks::value_trait] pub trait ModuleIdStrategy { @@ -52,13 +56,25 @@ impl ModuleIdStrategy for GlobalModuleIdStrategy { } // TODO this shouldn't happen // It means we missed something when generating the map - bail!("ModuleId not found for ident: {:?}", ident_string) + ModuleIssue { + ident: ident.to_resolved().await?, + title: StyledString::Text( + format!("ModuleId not found for ident: {:?}", ident_string).into(), + ) + .resolved_cell(), + description: StyledString::Text( + format!("ModuleId not found for ident: {:?}", ident_string).into(), + ) + .resolved_cell(), + } + .resolved_cell() + .emit(); - // Ok(ModuleId::String( - // hash_xxh3_hash64(ident.to_string().await?) - // .to_string() - // .into(), - // ) - // .cell()) + Ok(ModuleId::String( + hash_xxh3_hash64(ident.to_string().await?) + .to_string() + .into(), + ) + .cell()) } }