Skip to content

Commit bedc045

Browse files
petebacondarwinAndrewKushnir
authored andcommitted
docs(ngcc): add additional next steps to an error (angular#37672)
The file-writing error in the this commit can also be the result of the ngcc process dying in the middle of writing files. This commit improves the error message to offer a resolution in case this is the reason for the error. Fixes angular#36393 PR Close angular#37672
1 parent a0595f4 commit bedc045

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

packages/compiler-cli/ngcc/src/writing/in_place_file_writer.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ export class InPlaceFileWriter implements FileWriter {
4949
`Tried to write ${
5050
backPath} with an ngcc back up file but it already exists so not writing, nor backing up, ${
5151
file.path}.\n` +
52-
`This error may be because two or more entry-points overlap and ngcc has been asked to process some files more than once.\n` +
53-
`You should check other entry-points in this package and set up a config to ignore any that you are not using.`);
52+
`This error may be caused by one of the following:\n` +
53+
`* two or more entry-points overlap and ngcc has been asked to process some files more than once.\n` +
54+
` In this case, you should check other entry-points in this package\n` +
55+
` and set up a config to ignore any that you are not using.\n` +
56+
`* a previous run of ngcc was killed in the middle of processing, in a way that cannot be recovered.\n` +
57+
` In this case, you should try cleaning the node_modules directory and any dist directories that contain local libraries. Then try again.`);
5458
}
5559
} else {
5660
if (this.fs.exists(file.path)) {

packages/compiler-cli/ngcc/test/writing/in_place_file_writer_spec.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,12 @@ runInEachFileSystem(() => {
101101
`Tried to write ${
102102
absoluteBackupPath}.__ivy_ngcc_bak with an ngcc back up file but it already exists so not writing, nor backing up, ${
103103
absoluteBackupPath}.\n` +
104-
`This error may be because two or more entry-points overlap and ngcc has been asked to process some files more than once.\n` +
105-
`You should check other entry-points in this package and set up a config to ignore any that you are not using.`
104+
`This error may be caused by one of the following:\n` +
105+
`* two or more entry-points overlap and ngcc has been asked to process some files more than once.\n` +
106+
` In this case, you should check other entry-points in this package\n` +
107+
` and set up a config to ignore any that you are not using.\n` +
108+
`* a previous run of ngcc was killed in the middle of processing, in a way that cannot be recovered.\n` +
109+
` In this case, you should try cleaning the node_modules directory and any dist directories that contain local libraries. Then try again.`
106110
]]);
107111
});
108112
});

0 commit comments

Comments
 (0)