Skip to content

Commit 51ad4bb

Browse files
committed
fix: friendly description of vague error
After all these years we have an opportunity to enjoy a human-friendly error description...
1 parent b653641 commit 51ad4bb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/loader.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,13 @@ export function pitch(request) {
124124
};
125125
});
126126
}
127-
this[MODULE_TYPE](text);
127+
try {
128+
this[MODULE_TYPE](text);
129+
} catch (error) {
130+
const pluginIsNotFound = `Invalid webpack configuration: plugin ${pluginName} is not found.
131+
It's highly likely that you forgot to add css extraction plugin into your webpack configuration(s)`;
132+
throw new Error(pluginIsNotFound);
133+
}
128134
} catch (e) {
129135
return callback(e);
130136
}

0 commit comments

Comments
 (0)