diff --git a/crates/turbopack-ecmascript/src/analyzer/mod.rs b/crates/turbopack-ecmascript/src/analyzer/mod.rs index 75c9d416e234a..dbd26db7b8f5a 100644 --- a/crates/turbopack-ecmascript/src/analyzer/mod.rs +++ b/crates/turbopack-ecmascript/src/analyzer/mod.rs @@ -370,7 +370,7 @@ pub enum JsValue { /// A constant primitive value. Constant(ConstantValue), /// An constant URL object. - Url(Url), + Url(Box), /// Some kind of well-known object /// (must not be an array, otherwise Array.concat needs to be changed) WellKnownObject(WellKnownObjectKind), diff --git a/crates/turbopack-ecmascript/src/analyzer/well_known.rs b/crates/turbopack-ecmascript/src/analyzer/well_known.rs index 9bf6061829a3a..04bd40eb43563 100644 --- a/crates/turbopack-ecmascript/src/analyzer/well_known.rs +++ b/crates/turbopack-ecmascript/src/analyzer/well_known.rs @@ -478,6 +478,7 @@ pub fn path_to_file_url(args: Vec) -> JsValue { if args.len() == 1 { if let Some(path) = args[0].as_str() { Url::from_file_path(path) + .map(Box::new) .map(JsValue::Url) .unwrap_or_else(|_| { JsValue::unknown(