WebpackDevMiddleware and Nodejs version compatibility
See original GitHub issueDescribe the bug
Serving static files and HMR using WebpackDevMiddleware results in 400 Bad request error using Node.js LTS 10.14.2.
Using Node.js LTS 8.12.0 works fine though.
To Reproduce
Steps to reproduce the behavior:
- Using this version of ASP.NET Core 2.1 or 2.2 and Node.js LTS version 10.14.2 or higher
- Run this code https://github.com/jdebarochez/dotnet-webpack-hotreload-issue
- With
dotnet run
- No files are served on the network
Expected behavior
- Files in wwwroot folder should be served, even with WebpackDevMiddleware enabled
- Updating frontend files should trigger hot module replacement in the browser.
Screenshots
Additional context
Here is the output in the console:
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET https://localhost:44350/dist/main.js
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[0]
All hosts are allowed.
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
Connection id "0HLJ3B2FEC0E1" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 12.8842ms 400
Commenting UseWebpackDevMiddleware
in Startup.cs
serve correctly our static files, but does not grant access to HotModuleReplacement.
Downgrading Node.js to version 8.12.0 solved our issue. Is there anyway to troubleshoot/debug/trace the Nodejs instance created by WebpackDevMiddleware class?
We found it by luck. We didn’t find anything anywhere documenting such issue. Our SPA was rendering fine for some of our teammates and not for everyone. I’m still doubting Nodejs to be the only reason of our bug here.
Output of dotnet --info
:
.NET Core SDK (reflecting any global.json):
Version: 2.2.100
Commit: b9f2fa0ca8
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.100\
Host (useful for support):
Version: 2.2.0
Commit: 1249f08fed
.NET Core SDKs installed:
1.1.0 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.402 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
2.2.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Having similar issues but with
Microsoft.AspNetCore.SpaServices.AngularCli
, when I try to view my app in a browser no response goes out and the browser request times out. Then one time I was able to see this error message:20 14:35:05.107 Microsoft.AspNetC E: An unhandled exception has occurred while executing the request. System.Net.Http.HttpRequestException: Failed to proxy the request to http://localhost:60846/, because the request to the proxy target failed. Check that the proxy target server is running and accepting requests to http://localhost:60846/.
I have Node v10.15.0.
Thanks for contacting us. We’re closing this issue as this doesn’t align with our long-term plans in this area. You can read more details about our vision for this area at https://github.com/aspnet/AspNetCore/issues/12890.