From eace6a2dc4fd44e97568465db6a3b5dd9d6c3bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 12:15:44 +0900 Subject: [PATCH] Fix more --- crates/next-api/src/project.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/next-api/src/project.rs b/crates/next-api/src/project.rs index 49e4442c2b7a8..5bc6efd558f4d 100644 --- a/crates/next-api/src/project.rs +++ b/crates/next-api/src/project.rs @@ -203,15 +203,19 @@ pub struct ProjectContainer { #[turbo_tasks::value_impl] impl ProjectContainer { #[turbo_tasks::function] - pub fn new(name: RcStr, dev: bool) -> Vc { - ProjectContainer { + pub async fn new(name: RcStr, dev: bool) -> Result> { + 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()) } } @@ -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,