Unverified Commit 7453d200 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: improve next/dynamic eventual consistentcy (#84560)

Use bail instead of panic to better recover from eventual consistency situations.
parent c0a7c842
......@@ -19,7 +19,7 @@
//! to wait until all the dynamic components are being loaded, this ensures hydration mismatch
//! won't occur
use anyhow::Result;
use anyhow::{Context, Result};
use next_core::{
next_app::ClientReferencesChunks, next_client_reference::EcmascriptClientReferenceModule,
next_dynamic::NextDynamicEntryModule,
......@@ -66,8 +66,12 @@ pub(crate) async fn collect_next_dynamic_chunks(
NextDynamicChunkAvailability::ClientReferences(client_reference_chunks) => {
client_reference_chunks
.client_component_client_chunks
.get(&parent_client_reference.unwrap())
.unwrap()
.get(
&parent_client_reference.context(
"Parent client reference not found for next/dynamic import",
)?,
)
.context("Client reference chunk group not found for next/dynamic import")?
.availability_info
}
NextDynamicChunkAvailability::AvailabilityInfo(availability_info) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment