Skip to content

Commit

Permalink
Fix more
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Nov 27, 2024
1 parent ac8e87b commit eace6a2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,19 @@ pub struct ProjectContainer {
#[turbo_tasks::value_impl]
impl ProjectContainer {
#[turbo_tasks::function]
pub fn new(name: RcStr, dev: bool) -> Vc<Self> {
ProjectContainer {
pub async fn new(name: RcStr, dev: bool) -> Result<Vc<Self>> {
Ok(ProjectContainer {
name,
// we only need to enable versioning in dev mode, since build
// is assumed to be operating over a static snapshot
versioned_content_map: dev.then(VersionedContentMap::new),
versioned_content_map: if dev {
Some(VersionedContentMap::new().to_resolved().await?)
} else {
None
},
options_state: State::new(None),
}
.cell()
.cell())
}
}

Expand Down Expand Up @@ -384,7 +388,7 @@ impl ProjectContainer {
} else {
NextMode::Build.cell()
},
versioned_content_map: self.versioned_content_map,
versioned_content_map: self.versioned_content_map.map(|v| *v),
build_id,
encryption_key,
preview_props,
Expand Down

0 comments on commit eace6a2

Please sign in to comment.