Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use turbopack_core::{

use super::util::{request_to_string, throw_module_not_found_expr};
use crate::{
chunk::EcmascriptChunkPlaceable,
references::util::throw_module_not_found_error_expr,
runtime_functions::{
TURBOPACK_ASYNC_LOADER, TURBOPACK_EXTERNAL_IMPORT, TURBOPACK_EXTERNAL_REQUIRE,
Expand Down Expand Up @@ -361,6 +362,13 @@ async fn to_single_pattern_mapping(
}
};
if let Some(chunkable) = ResolvedVc::try_downcast::<Box<dyn ChunkableModule>>(module) {
// Check if it's an EcmascriptChunkPlaceable
// Non-JS modules should be ignored as their side effects
// are handled through their own chunk types
if ResolvedVc::try_downcast::<Box<dyn EcmascriptChunkPlaceable>>(module).is_none() {
return Ok(SinglePatternMapping::Ignored);
}

match resolve_type {
ResolveType::AsyncChunkLoader => {
let loader_id = chunking_context.async_loader_chunk_item_id(*chunkable);
Expand Down
Loading