Pass through error stack when NPM module loading failed in aspnet-webpack and aspnet-prerendering to make debugging easier

This commit is contained in:
SteveSandersonMS
2016-09-21 11:08:04 +01:00
parent 5214a553a7
commit 232e908ce8
4 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "aspnet-prerendering",
"version": "1.0.6",
"version": "1.0.7",
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
"main": "index.js",
"scripts": {

View File

@@ -128,7 +128,7 @@ function findBootModule<T>(applicationBasePath: string, bootModule: BootModuleIn
try {
aspNetWebpackModule = require('aspnet-webpack');
} catch (ex) {
callback('To load your boot module via webpack (i.e., if you specify a \'webpackConfig\' option), you must install the \'aspnet-webpack\' NPM package.', null);
callback('To load your boot module via webpack (i.e., if you specify a \'webpackConfig\' option), you must install the \'aspnet-webpack\' NPM package. Error encountered while loading \'aspnet-webpack\': ' + ex.stack, null);
return;
}

View File

@@ -1,6 +1,6 @@
{
"name": "aspnet-webpack",
"version": "1.0.12",
"version": "1.0.13",
"description": "Helpers for using Webpack in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
"main": "index.js",
"scripts": {

View File

@@ -73,7 +73,7 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
try {
aspNetWebpackReactModule = require('aspnet-webpack-react');
} catch(ex) {
callback('To use ReactHotModuleReplacement, you must install the NPM package \'aspnet-webpack-react\'.', null);
callback('ReactHotModuleReplacement failed because of an error while loading \'aspnet-webpack-react\'. Error was: ' + ex.stack, null);
return;
}
@@ -93,7 +93,7 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
try {
webpackHotMiddlewareModule = require('webpack-hot-middleware');
} catch (ex) {
callback('To use HotModuleReplacement, you must install the NPM package \'webpack-hot-middleware\'.', null);
callback('HotModuleReplacement failed because of an error while loading \'webpack-hot-middleware\'. Error was: ' + ex.stack, null);
return;
}
app.use(webpackHotMiddlewareModule(compiler));