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", "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.", "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", "main": "index.js",
"scripts": { "scripts": {

View File

@@ -128,7 +128,7 @@ function findBootModule<T>(applicationBasePath: string, bootModule: BootModuleIn
try { try {
aspNetWebpackModule = require('aspnet-webpack'); aspNetWebpackModule = require('aspnet-webpack');
} catch (ex) { } 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; return;
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "aspnet-webpack", "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.", "description": "Helpers for using Webpack in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@@ -73,7 +73,7 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
try { try {
aspNetWebpackReactModule = require('aspnet-webpack-react'); aspNetWebpackReactModule = require('aspnet-webpack-react');
} catch(ex) { } 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; return;
} }
@@ -93,7 +93,7 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
try { try {
webpackHotMiddlewareModule = require('webpack-hot-middleware'); webpackHotMiddlewareModule = require('webpack-hot-middleware');
} catch (ex) { } 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; return;
} }
app.use(webpackHotMiddlewareModule(compiler)); app.use(webpackHotMiddlewareModule(compiler));