Skip to content

Commit 897c107

Browse files
RolfBabijnweaverryan
authored andcommitted
Clarify missing css file error message
1 parent c4e3fd2 commit 897c107

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/friendly-errors/formatters/missing-css-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function formatErrors(errors) {
2222
chalk.red('Module build failed: Module not found:')
2323
);
2424
for (let error of errors) {
25-
messages.push(`${error.file} contains a reference to the file ${error.ref}.`);
25+
messages.push(`"${error.file}" contains a reference to the file "${error.ref}".`);
2626
messages.push('This file can not be found, please check it for typos or update it if the file got moved.');
2727
messages.push('');
2828
}

lib/friendly-errors/formatters/missing-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function formatErrors(errors) {
5050
if (error.loaderName) {
5151
messages.push(`${chalk.bgGreen.black('', 'FIX', '')} To ${loaderFeatures.getFeatureDescription(error.loaderName)}:`);
5252
} else {
53-
messages.push(`${chalk.bgGreen.black('', 'FIX', '')} To load ${error.file}:`);
53+
messages.push(`${chalk.bgGreen.black('', 'FIX', '')} To load "${error.file}":`);
5454
}
5555

5656
let index = 0;

test/friendly-errors/formatters/missing-css-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('formatters/missing-css-file', () => {
3939
};
4040

4141
const actualErrors = formatter([error]);
42-
expect(JSON.stringify(actualErrors)).to.contain('/some/file.css contains a reference to the file ../images/foo.png');
42+
expect(JSON.stringify(actualErrors)).to.contain('\\"/some/file.css\\" contains a reference to the file \\"../images/foo.png\\"');
4343
expect(JSON.stringify(actualErrors)).to.contain('This file can not be found, please check it for typos or update it if the file got moved.');
4444
// all needed packages will be present when running tests
4545
expect(JSON.stringify(actualErrors)).to.not.contain('yarn add');

test/friendly-errors/formatters/missing-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('formatters/missing-loader', () => {
5252
};
5353

5454
const actualErrors = formatter([error]);
55-
expect(JSON.stringify(actualErrors)).to.contain('To load /some/file.jpg');
55+
expect(JSON.stringify(actualErrors)).to.contain('To load \\"/some/file.jpg\\"');
5656
expect(JSON.stringify(actualErrors)).to.contain('You may need to install and configure a special loader');
5757
});
5858

0 commit comments

Comments
 (0)