Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): fix crash when Sass error occurs
Browse files Browse the repository at this point in the history
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)
```
  • Loading branch information
alan-agius4 committed Sep 28, 2022
1 parent 91a6bd4 commit fb5a66a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/angular_devkit/build_angular/src/sass/worker.ts
Expand Up @@ -93,7 +93,18 @@ parentPort.on('message', ({ id, hasImporter, source, options }: RenderRequestMes
id,
error: {
span: {
...span,
text: span.text,
context: span.context,
end: {
column: span.end.column,
offset: span.end.offset,
line: span.end.line,
},
start: {
column: span.start.column,
offset: span.start.offset,
line: span.start.line,
},
url: span.url ? fileURLToPath(span.url) : undefined,
},
message,
Expand Down

0 comments on commit fb5a66a

Please sign in to comment.