diff --git a/crates/turbo-tasks-fs/src/lib.rs b/crates/turbo-tasks-fs/src/lib.rs index 0d2174eda7532..8340b8b42cca5 100644 --- a/crates/turbo-tasks-fs/src/lib.rs +++ b/crates/turbo-tasks-fs/src/lib.rs @@ -872,6 +872,9 @@ impl FileSystemPath { self.path.is_empty() } + /// Returns the path of `inner` relative to `self`. + /// + /// Note: this method always strips the leading `/` from the result. pub fn get_path_to<'a>(&self, inner: &'a FileSystemPath) -> Option<&'a str> { if self.fs != inner.fs { return None; diff --git a/crates/turbopack-node/src/render/rendered_source.rs b/crates/turbopack-node/src/render/rendered_source.rs index d574bba01b469..25933503b90b9 100644 --- a/crates/turbopack-node/src/render/rendered_source.rs +++ b/crates/turbopack-node/src/render/rendered_source.rs @@ -226,14 +226,14 @@ impl GetContentSourceContent for NodeRenderGetContentResult { url: url.clone(), raw_query: raw_query.clone(), raw_headers: raw_headers.clone(), - path: format!("/{}", source.pathname.await?), + path: source.pathname.await?.clone_value(), data: Some(self.render_data.await?), } .cell(), ) .issue_context( entry.module.ident().path(), - format!("server-side rendering /{}", source.pathname.await?), + format!("server-side rendering {}", source.pathname.await?), ) .await?; Ok(match *result.await? {