This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Call to Node module failed with error: '...\ClientApp\dist\main-server' #363
Copy link
Copy link
Closed
Description
An unhandled exception has occurred: Call to Node module failed with error: Error: Cannot find module 'C:\Users\tmitchell\Downloads\Jav
aScriptServices-dev\JavaScriptServices-dev\templates\ReactReduxSpa\ClientApp\dist\main-server'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at findBootModule (C:\Users\tmitchell\Downloads\JavaScriptServices-dev\JavaScriptServices-dev\templates\ReactReduxSpa\node_modules\aspnet
-prerendering\Prerendering.js:98:24)
at findBootFunc (C:\Users\tmitchell\Downloads\JavaScriptServices-dev\JavaScriptServices-dev\templates\ReactReduxSpa\node_modules\aspnet-p
rerendering\Prerendering.js:103:5)
at renderToString (C:\Users\tmitchell\Downloads\JavaScriptServices-dev\JavaScriptServices-dev\templates\ReactReduxSpa\node_modules\aspnet
-prerendering\Prerendering.js:10:5)
at module.exports.renderToString (C:\Users\tmitchell\AppData\Local\Temp\tmp53F7.tmp:19:46)
at C:\Users\tmitchell\AppData\Local\Temp\tmp5408.tmp:113:19
at IncomingMessage.<anonymous> (C:\Users\tmitchell\AppData\Local\Temp\tmp5408.tmp:132:38)
System.Exception: Call to Node module failed with error: Error: Cannot find module 'C:\Users\tmitchell\Downloads\JavaScriptServices-dev\JavaS
criptServices-dev\templates\ReactReduxSpa\ClientApp\dist\main-server'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at findBootModule (C:\Users\tmitchell\Downloads\JavaScriptServices-dev\JavaScriptServices-dev\templates\ReactReduxSpa\node_modules\aspnet
-prerendering\Prerendering.js:98:24)
at findBootFunc (C:\Users\tmitchell\Downloads\JavaScriptServices-dev\JavaScriptServices-dev\templates\ReactReduxSpa\node_modules\aspnet-p
rerendering\Prerendering.js:103:5)
at renderToString (C:\Users\tmitchell\Downloads\JavaScriptServices-dev\JavaScriptServices-dev\templates\ReactReduxSpa\node_modules\aspnet
-prerendering\Prerendering.js:10:5)
at module.exports.renderToString (C:\Users\tmitchell\AppData\Local\Temp\tmp53F7.tmp:19:46)
at C:\Users\tmitchell\AppData\Local\Temp\tmp5408.tmp:113:19
at IncomingMessage.<anonymous> (C:\Users\tmitchell\AppData\Local\Temp\tmp5408.tmp:132:38)
at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.<InvokeExportAsync>d__7`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.<InvokeExportAsync>d__13`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__10`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.AspNetCore.SpaServices.Prerendering.PrerenderTagHelper.<ProcessAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AspNetCore._Views_Home_Index_cshtml.<ExecuteAsync>d__31.MoveNext() in /Views/Home/Index.cshtml:line 2
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.<RenderPageAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.<RenderAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.<ExecuteAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.ViewResult.<ExecuteResultAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeResultAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeResultFilterAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAllResultFiltersAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeResourceFilterAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()
I'm not sure at this time what's causing it. I'm going to do some more research and figure it out.
I'm using DotNetCore.1.0.1-VS2015Tools.Preview2.0.2.
I have the latest Node and npm installed.
Issue is line 5 of Views\Home\index.cshtml
Removing the asp-prerender-module="ClientApp/dist/main-server" gives the following error in the js console.
http://localhost:5000/dist/main-client.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:5000/dist/vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:5000/dist/site.css Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:5000/dist/vendor.css Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:5000/dist/main-client.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:5000/dist/site.css Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:5000/dist/vendor.css Failed to load resource: the server responded with a status of 404 (Not Found)
this means webpack is not bundling correctly, which leads me to conclude this is an issue with the webpack config. Still researching.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
MarkPieszak commentedon Oct 5, 2016
@SteveSandersonMS This is why I changed those names, seems webpack was changed but these weren't renamed?
SteveSandersonMS commentedon Oct 6, 2016
@scy0846 Have you checked that
main-server.js/main-client.jsreally exist at those locations on disk? If they aren't, have you really runwebpack --config webpack.config.vendor.jsandwebpackfrom the project root dir (i.e.,C:\Users\tmitchell\Downloads\JavaScriptServices-dev\JavaScriptServices-dev\templates\ReactReduxSpa\)?@MarkPieszak I'm not sure what you mean. Can you be specific about what you think has changed and why exactly it's a problem? My best guess is that you're referring to this line from
webpack.config.jsin the ReactReduxSpa template:Are you concerned that the bundle output name
main-clientisn't the same as the entry point fileboot-client.tsx? There's no reason why they should be the same -boot-client.tsxis the name of the entry point file, which references many other files, andmain-clientis the name for the complete bundle that includes the whole set of dependencies.MarkPieszak commentedon Oct 6, 2016
@SteveSandersonMS You're right, this must of been something I changed unknowingly on my end, apologies! Also I reverted the naming conventions back to the
boot-in the TS2 PR.CaffeinatedFunctionality commentedon Oct 10, 2016
main-server.js/main-client.jsdo not exist. When I try to runwebpackI get this errorSteveSandersonMS commentedon Oct 10, 2016
@scy0846 Thanks for the info.
You're running an old version of Node.js that doesn't support arrow functions. For now at least, you'll need Node 4.x or later.
CaffeinatedFunctionality commentedon Oct 10, 2016
Actually I'm running 6.7.0
SteveSandersonMS commentedon Oct 10, 2016
@scy0846 I'm not sure how that can be right. Node 6.7.0 does have support for arrow functions, but the error message you've posted is exactly what old versions of Node (0.x) report because they don't support arrow functions. If you run
node -vin the same console window that you got the error from runningwebpack, does it really report 6.7.0?CaffeinatedFunctionality commentedon Oct 10, 2016
I think my last post was an issue with my work machine. Windows says it's 6.7.0, but my terminal says 0.12.2. I think I've got a bigger issue to run down, but it's not your program. Sorry about that. Thank you. I'm going to switch to my personal machine which does show 6.7.0 and see if I can get it to run correctly on that.
SteveSandersonMS commentedon Oct 10, 2016
No problem - thanks for confirming!
CaffeinatedFunctionality commentedon Oct 10, 2016
yep. Looks like that part was a config mistake. It was using my 32 bit node file. Anyways I'm still getting the original issue with
main-server.jsnot being there.SteveSandersonMS commentedon Oct 10, 2016
You still haven't run
webpack(you only ranwebpack --config webpack.config.vendor.js).CaffeinatedFunctionality commentedon Oct 10, 2016
Thank you. You are correct. Sorry about that. I was trying to go by the instructions in the blog and missed that I needed to run that. I had to install
webpack-node-externalsfirst. It works. Thank you for your help.patrickgomes1968 commentedon May 22, 2017
THANK YOU, @SteveSanderson !