Skip to content

Commit fb5a66a

Browse files
committed
fix(@angular-devkit/build-angular): fix crash when Sass error occurs
In some cases the build will crash when there is a Sass error due to the fact that the `span` property on the Error instance cannot be cloned. ``` process.nextTick(() => { throw err; }); ^ DataCloneError: function StaticClosure() { } could not be cloned. at MessagePort.<anonymous> (/node_modules/@angular-devkit/build-angular/src/sass/worker.js:61:41) ```
1 parent 91a6bd4 commit fb5a66a

File tree

1 file changed

+12
-1
lines changed
  • packages/angular_devkit/build_angular/src/sass

1 file changed

+12
-1
lines changed

packages/angular_devkit/build_angular/src/sass/worker.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,18 @@ parentPort.on('message', ({ id, hasImporter, source, options }: RenderRequestMes
9393
id,
9494
error: {
9595
span: {
96-
...span,
96+
text: span.text,
97+
context: span.context,
98+
end: {
99+
column: span.end.column,
100+
offset: span.end.offset,
101+
line: span.end.line,
102+
},
103+
start: {
104+
column: span.start.column,
105+
offset: span.start.offset,
106+
line: span.start.line,
107+
},
97108
url: span.url ? fileURLToPath(span.url) : undefined,
98109
},
99110
message,

0 commit comments

Comments
 (0)