Skip to content

Commit 2529c07

Browse files
acouchjhnns
authored andcommitted
fix: Report error to user for problems loading node-sass (#562)
* Update loader.js * Update index.test.js
1 parent 2759618 commit 2529c07

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function sassLoader(content) {
2929
sassVersion = /^(\d+)/.exec(require("node-sass/package.json").version).pop();
3030
} catch (e) {
3131
throw new Error(
32-
"`sass-loader` requires `node-sass` >=4. Please install a compatible version."
32+
"Error loading `node-sass`: " + e
3333
);
3434
}
3535

test/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ describe("sass-loader", () => {
285285
}, (err) => {
286286
module._resolveFilename = originalResolve;
287287
mockRequire.reRequire("node-sass");
288-
err.message.should.match(/Please install a compatible version/);
288+
err.message.should.match(/Error loading `node-sass`/);
289289
done();
290290
});
291291
});

0 commit comments

Comments
 (0)