Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b82e70e

Browse filesBrowse files
Fix for prerendering hanging if webpack compilation fails
1 parent 44bd5f1 commit b82e70e
Copy full SHA for b82e70e

File tree

Expand file treeCollapse file tree

2 files changed

+10
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-5
lines changed
Open diff view settings
Collapse file

‎src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json‎

Copy file name to clipboardExpand all lines: src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aspnet-webpack",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Helpers for using Webpack in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
55
"main": "index.js",
66
"scripts": {
Collapse file

‎src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts‎

Copy file name to clipboardExpand all lines: src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function loadViaWebpackNoCache<T>(webpackConfigPath: string, modulePath: string)
5252
webpackConfig.plugins = webpackConfig.plugins.filter(plugin => {
5353
return !(plugin instanceof webpack.optimize.CommonsChunkPlugin);
5454
});
55-
55+
5656
// The typical use case for DllReferencePlugin is for referencing vendor modules. In a Node
5757
// environment, it doesn't make sense to load them from a DLL bundle, nor would that even
5858
// work, because then you'd get different module instances depending on whether a module
@@ -78,9 +78,14 @@ function loadViaWebpackNoCache<T>(webpackConfigPath: string, modulePath: string)
7878
if (err) {
7979
reject(err);
8080
} else {
81-
const fileContent = compiler.outputFileSystem.readFileSync('/webpack-output.js', 'utf8');
82-
const moduleInstance = requireFromString<T>(fileContent);
83-
resolve(moduleInstance);
81+
// We're in a callback, so need an explicit try/catch to propagate any errors up the promise chain
82+
try {
83+
const fileContent = compiler.outputFileSystem.readFileSync('/webpack-output.js', 'utf8');
84+
const moduleInstance = requireFromString<T>(fileContent);
85+
resolve(moduleInstance);
86+
} catch(ex) {
87+
reject(ex);
88+
}
8489
}
8590
});
8691
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.