mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
In SpaServices NuGet package, pass through error stack when NPM modules fail to load
This commit is contained in:
@@ -4,7 +4,10 @@ module.exports.renderToString = function (callback) {
|
|||||||
try {
|
try {
|
||||||
aspNetPrerendering = require('aspnet-prerendering');
|
aspNetPrerendering = require('aspnet-prerendering');
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
callback('To use prerendering, you must install the \'aspnet-prerendering\' NPM package.');
|
// Developers sometimes have trouble with badly-configured Node installations, where it's unable
|
||||||
|
// to find node_modules. Or they accidentally fail to deploy node_modules, or even to run 'npm install'.
|
||||||
|
// Make sure such errors are reported back to the .NET part of the app.
|
||||||
|
callback('Prerendering failed because of an error while loading \'aspnet-prerendering\'. Error was: ' + ex.stack);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ module.exports.createWebpackDevServer = function (callback) {
|
|||||||
try {
|
try {
|
||||||
aspNetWebpack = require('aspnet-webpack');
|
aspNetWebpack = require('aspnet-webpack');
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
callback('To use webpack dev middleware, you must install the \'aspnet-webpack\' NPM package.');
|
// Developers sometimes have trouble with badly-configured Node installations, where it's unable
|
||||||
|
// to find node_modules. Or they accidentally fail to deploy node_modules, or even to run 'npm install'.
|
||||||
|
// Make sure such errors are reported back to the .NET part of the app.
|
||||||
|
callback('Webpack dev middleware failed because of an error while loading \'aspnet-webpack\'. Error was: ' + ex.stack);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user