Skip to content

Commit b0e340c

Browse files
authored
refactor: improve module parser loader hint
1 parent 89888bc commit b0e340c

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.changeset/real-starfishes-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": patch
3+
---
4+
5+
Improved parsing error reporting by adding a link to the loader documentation.

lib/ModuleParseError.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class ModuleParseError extends WebpackError {
4040
"\nFor files that transpile to WebAssembly, make sure to set the module type in the 'module.rules' section of the config (e. g. 'type: \"webassembly/async\"').";
4141
} else if (!loaders) {
4242
message +=
43-
"\nYou may need an appropriate loader to handle this file type.";
43+
"\nYou may need an appropriate loader to handle this file type. " +
44+
"See https://webpack.js.org/concepts/loaders";
4445
} else if (loaders.length >= 1) {
4546
message += `\nFile was processed with these loaders:${loaders
4647
.map((loader) => `\n * ${loader}`)

0 commit comments

Comments
 (0)