-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
area-ui-renderingIncludes: MVC Views/Pages, Razor Views/PagesIncludes: MVC Views/Pages, Razor Views/Pagesfeature-spagood first issueGood for newcomers.Good for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Milestone
Description
Given a ASP.NET project with SPA setup:
<PropertyGroup>
<SpaRoot>client-app\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<SpaProxyServerUrl>https://localhost:5173</SpaProxyServerUrl>
<SpaProxyLaunchCommand>pnpm dev</SpaProxyLaunchCommand>
</PropertyGroup>SpaProxyLaunchManager failes to launch SPA development server, saying it cannot find 'pnpm.cmd':
info: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
No SPA development server running at https://localhost:5173 found.
fail: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
Failed to launch the SPA development server 'pnpm dev'.
System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'pnpm.cmd' with working directory 'C:\project\client-app\'. 지정된 파일을 찾을 수 없습니다.
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager.LaunchDevelopmentProxy()
fail: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
Couldn't start the SPA development server with command 'pnpm dev'.
info: Microsoft.AspNetCore.SpaProxy.SpaProxyMiddleware[0]
SPA proxy is not ready. Returning temporary landing page.
It makes sense because, using a pnpm installation standalone script, we do not have pnpm.cmd, but only pnpm.exe at %localappdata%\pnpm\.
I know I can use pnpm modifying SpaProxyLaunchCommand to have the extension like pnpm.exe dev,
aspnetcore/src/Middleware/Spa/SpaProxy/src/SpaProxyLaunchManager.cs
Lines 169 to 174 in 589aa11
| if (OperatingSystem.IsWindows() && !Path.HasExtension(command)) | |
| { | |
| // On windows we transform npm/yarn to npm.cmd/yarn.cmd so that the command | |
| // can actually be found when we start the process. This is overridable if | |
| // necessary by explicitly setting up the extension on the command. | |
| command = $"{command}.cmd"; |
but it would be great if we could omit it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-ui-renderingIncludes: MVC Views/Pages, Razor Views/PagesIncludes: MVC Views/Pages, Razor Views/Pagesfeature-spagood first issueGood for newcomers.Good for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue