Skip to content

Commit 6191d06

Browse files
committed
fix(@angular-devkit/build-angular): address Unable to deserialize cloned data issue with Yarn PnP
Occasionally, when using Yarn PnP, an error message `Unable to deserialize cloned data` arises during the optimization phase of JavaScript bundles. This update rectifies the problem. See: http://b/335203823 (cherry picked from commit 1c3ff61)
1 parent 0335d6a commit 6191d06

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/javascript-transformer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ export class JavaScriptTransformer {
111111
sideEffects,
112112
...this.#commonOptions,
113113
},
114-
{ transferList: [data.buffer] },
114+
{
115+
// The below is disable as with Yarn PNP this causes build failures with the below message
116+
// `Unable to deserialize cloned data`.
117+
transferList: process.versions.pnp ? undefined : [data.buffer],
118+
},
115119
)) as Uint8Array;
116120

117121
// If there is a cache then store the result

0 commit comments

Comments
 (0)