Skip to content

Commit

Permalink
WIP: log instead of error for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Dec 12, 2024
1 parent 140a1b1 commit c068537
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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())
}
}

0 comments on commit c068537

Please sign in to comment.