Skip to content

Commit

Permalink
fix: Report error to user for problems loading node-sass (#562)
Browse files Browse the repository at this point in the history
* Update loader.js
* Update index.test.js
  • Loading branch information
acouch authored and jhnns committed Apr 24, 2018
1 parent 2759618 commit 2529c07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function sassLoader(content) {
sassVersion = /^(\d+)/.exec(require("node-sass/package.json").version).pop();
} catch (e) {
throw new Error(
"`sass-loader` requires `node-sass` >=4. Please install a compatible version."
"Error loading `node-sass`: " + e
);
}

Expand Down
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ describe("sass-loader", () => {
}, (err) => {
module._resolveFilename = originalResolve;
mockRequire.reRequire("node-sass");
err.message.should.match(/Please install a compatible version/);
err.message.should.match(/Error loading `node-sass`/);
done();
});
});
Expand Down

0 comments on commit 2529c07

Please sign in to comment.