You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
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.
WebPack SPA Services: "cannot find module" when ProjectPath is a different directory #573
System.AggregateException was unhandled by user code
HResult=-2146233088
Message=One or more errors occurred. (Call to Node module failed with error: Error: Cannot find module '..\Web.Client\webpack.config.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.resolve (internal/module.js:27:19)
at Object.requireNewCopy (C:\Web.Platform\Web.Client\node_modules\aspnet-webpack\RequireNewCopy.js:6:34)
at createWebpackDevServer (C:\Web.Platform\Web.Client\node_modules\aspnet-webpack\WebpackDevMiddleware.js:133:47)
at createWebpackDevServer (C:\Users\harsimranb\AppData\Local\Temp\tmp5544.tmp:74:50)
at C:\Users\harsimranb\AppData\Local\Temp\tmp5601.tmp:113:19
at IncomingMessage.<anonymous> (C:\Users\harsimranb\AppData\Local\Temp\tmp5601.tmp:132:38)
at emitNone (events.js:86:13)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12))
Source=System.Private.CoreLib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.AspNetCore.Builder.WebpackDevMiddleware.UseWebpackDevMiddleware(IApplicationBuilder appBuilder, WebpackDevMiddlewareOptions options)
at Web.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IHttpContextAccessor accessor) in C:\Web.Platform\Web\Startup.cs:line 115
I just realized that the ProjectPath is an absolute path, not a relative path. It's obvious because of the temp files, totally missed it. =/ I updated my code to:
I am no longer getting that error. Can someone confirm that I have this correct now? Also, would be nice to rename ProjectPath to AbsoluteProjectPath, or perhaps update the summary to acknowledge that.
Reacted by Robert Sandu, Dmitrii Kosinov, Hüseyin Yağlı, Nelli Lovchikova, denkata, Jonathan Torley and lulzzz
@harsimranb I did not realise that ProjectPath was absolute until I read this issue. This allowed me to keep the client app in a separate location from the hosting AspNet application. Thank you.
I know this is old, but I think there's a bug there. Specifying a folder (e.g. "ClientApp") results in node looking for the folder incorrectly, but still relative to the project folder (from ProcMon):
Note the reference to node_modules.
Can we please get this reopened, or at least get some documentation about it not being relative?
Activity
harsimranb commentedon Jan 10, 2017
I just realized that the
ProjectPathis an absolute path, not a relative path. It's obvious because of the temp files, totally missed it. =/ I updated my code to:I am no longer getting that error. Can someone confirm that I have this correct now? Also, would be nice to rename ProjectPath to AbsoluteProjectPath, or perhaps update the summary to acknowledge that.
liddellj commentedon Apr 11, 2017
@harsimranb I did not realise that
ProjectPathwas absolute until I read this issue. This allowed me to keep the client app in a separate location from the hosting AspNet application. Thank you.jonathantorley commentedon Sep 7, 2018
I know this is old, but I think there's a bug there. Specifying a folder (e.g. "ClientApp") results in node looking for the folder incorrectly, but still relative to the project folder (from ProcMon):

Note the reference to node_modules.
Can we please get this reopened, or at least get some documentation about it not being relative?