JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

aspnet-webpack: webpack dev middleware failed to run

Open SergeyRudakov opened this issue 10 years ago • 2 comments

When I tried to run app in the dev mode, I've got the following exception:

Call to Node module failed with error: To use webpack dev middleware, you must install the 'aspnet-webpack' NPM package.

In this code block:

if (env.IsDevelopment()) {
                app.UseWebpackDevMiddleware(
                    new WebpackDevMiddlewareOptions
                    {
                        HotModuleReplacement = true
                    }
            );
 }

aspnet-webpack is installed and app is working all right in production mode. How to enable dev middleware? Can I enable source map debugging (TypeScript)?

SergeyRudakov avatar Jul 14 '16 21:07 SergeyRudakov

Please provide your project.json file and webpack.config

laskoviymishka avatar Jul 14 '16 22:07 laskoviymishka

I cloned my project on the other computer and was able to run it. So it must be dev station environment problem. project.json and webpack.config files were not changed. Sorry for the false alarm, I'll try to investigate the problerm and send additional info if I learn more.

BTW - I have 2 warnings during NPM install. VS shows waring icon on NPM but application runs well including hot module replacement:

npm WARN install Couldn't install optional dependency: Unsupported npm WARN EPEERINVALID [email protected] requires a peer of parse5@^1.5.0 but none was installed.

Thanks,

SergeyRudakov avatar Jul 15 '16 06:07 SergeyRudakov