Skip to content

Clarify missing css file error message #940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/friendly-errors/formatters/missing-css-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function formatErrors(errors) {
chalk.red('Module build failed: Module not found:')
);
for (let error of errors) {
messages.push(`${error.file} contains a reference to the file ${error.ref}.`);
messages.push(`"${error.file}" contains a reference to the file "${error.ref}".`);
messages.push('This file can not be found, please check it for typos or update it if the file got moved.');
messages.push('');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/friendly-errors/formatters/missing-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function formatErrors(errors) {
if (error.loaderName) {
messages.push(`${chalk.bgGreen.black('', 'FIX', '')} To ${loaderFeatures.getFeatureDescription(error.loaderName)}:`);
} else {
messages.push(`${chalk.bgGreen.black('', 'FIX', '')} To load ${error.file}:`);
messages.push(`${chalk.bgGreen.black('', 'FIX', '')} To load "${error.file}":`);
}

let index = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/friendly-errors/formatters/missing-css-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('formatters/missing-css-file', () => {
};

const actualErrors = formatter([error]);
expect(JSON.stringify(actualErrors)).to.contain('/some/file.css contains a reference to the file ../images/foo.png');
expect(JSON.stringify(actualErrors)).to.contain('\\"/some/file.css\\" contains a reference to the file \\"../images/foo.png\\"');
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.');
// all needed packages will be present when running tests
expect(JSON.stringify(actualErrors)).to.not.contain('yarn add');
Expand Down
2 changes: 1 addition & 1 deletion test/friendly-errors/formatters/missing-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('formatters/missing-loader', () => {
};

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

Expand Down