fullstackproltd / AspNetCoreSpa

Asp.Net 7.0 & Angular 15 SPA Fullstack application with plenty of examples. Live demo:
https://aspnetcorespa.fullstackpro.co.uk
MIT License
1.48k stars 465 forks source link

Cannot read property '0' of undefined #49

Closed utilitydelta closed 7 years ago

utilitydelta commented 7 years ago

Hi,

I just cloned your repo. Went through the steps in the readme. Hit F5. Got the following error under configure() where webpackdevmiddleware is registered.

System.AggregateException was unhandled by user code HResult=-2146233088 Message=One or more errors occurred. (Call to Node module failed with error: TypeError: Cannot read property '0' of undefined at ExternalModuleFactoryPlugin. (C:\Users\tyson\Source\Repos\AspNetCoreSpa\node_modules\webpack\lib\ExternalModuleFactoryPlugin.js:18:38) at C:\Users\tyson\node_modules\webpack\lib\NormalModuleFactory.js:159:3 at NormalModuleFactory.applyPluginsAsyncWaterfall (C:\Users\tyson\node_modules\tapable\lib\Tapable.js:75:69) at NormalModuleFactory.create (C:\Users\tyson\node_modules\webpack\lib\NormalModuleFactory.js:144:8) at C:\Users\tyson\node_modules\webpack\lib\Compilation.js:214:11 at C:\Users\tyson\node_modules\async\lib\async.js:181:20 at Object.async.forEachOf.async.eachOf (C:\Users\tyson\node_modules\async\lib\async.js:233:13) at Object.async.forEach.async.each (C:\Users\tyson\node_modules\async\lib\async.js:209:22) at Compilation.addModuleDependencies (C:\Users\tyson\node_modules\webpack\lib\Compilation.js:185:8) at Compilation.processModuleDependencies (C:\Users\tyson\node_modules\webpack\lib\Compilation.js:170:7)) Source=System.Private.CoreLib StackTrace: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.AspNetCore.Builder.WebpackDevMiddleware.UseWebpackDevMiddleware(IApplicationBuilder appBuilder, WebpackDevMiddlewareOptions options) at AspNetCoreSpa.Startup.<Configure>d__7.MoveNext() in C:\Users\tyson\Source\Repos\AspNetCoreSpa\Startup.cs:line 162 InnerException: HResult=-2146233088 Message=Call to Node module failed with error: TypeError: Cannot read property '0' of undefined at ExternalModuleFactoryPlugin.<anonymous> (C:\Users\tyson\Source\Repos\AspNetCoreSpa\node_modules\webpack\lib\ExternalModuleFactoryPlugin.js:18:38) at C:\Users\tyson\node_modules\webpack\lib\NormalModuleFactory.js:159:3 at NormalModuleFactory.applyPluginsAsyncWaterfall (C:\Users\tyson\node_modules\tapable\lib\Tapable.js:75:69) at NormalModuleFactory.create (C:\Users\tyson\node_modules\webpack\lib\NormalModuleFactory.js:144:8) at C:\Users\tyson\node_modules\webpack\lib\Compilation.js:214:11 at C:\Users\tyson\node_modules\async\lib\async.js:181:20 at Object.async.forEachOf.async.eachOf (C:\Users\tyson\node_modules\async\lib\async.js:233:13) at Object.async.forEach.async.each (C:\Users\tyson\node_modules\async\lib\async.js:209:22) at Compilation.addModuleDependencies (C:\Users\tyson\node_modules\webpack\lib\Compilation.js:185:8) at Compilation.processModuleDependencies (C:\Users\tyson\node_modules\webpack\lib\Compilation.js:170:7) Source=Microsoft.AspNetCore.NodeServices StackTrace: at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.<InvokeExportAsync>d__71.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.<InvokeExportAsync>d__131.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__101.MoveNext() InnerException:

Any tips to fix? Cheers Tyson

asadsahi commented 7 years ago

@utilitydelta did npm install happened successfully? Can you try removing node_modules folder and try npm install again to see if it fixes the issue?