Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aspire not working with REACT Application #7277

Open
1 task done
martycook opened this issue Jan 27, 2025 · 0 comments
Open
1 task done

Aspire not working with REACT Application #7277

martycook opened this issue Jan 27, 2025 · 0 comments
Labels
untriaged New issue has not been triaged

Comments

@martycook
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Aspire doesn't seem to want to work with a Visual Studio generated REACT application. There are no endpoints in the Aspire portal for the app. I have to manually open a browser and type in the Url to open the application. I can live with that, if this just isn't something that was ever intended, for Aspire, but it seems like this should work.

By the way, thanks in advance. Aspire is an awesome tool.

Expected Behavior

I expected the endpoint(s) for the REACT app to be listed in the "endpoints" column of the Aspire portal.

Steps To Reproduce

Here is a quick git with code for the problem: https://github.com/martycook/AspireApp1

I started with an out-of-the-box solution generated with the ".NET Aspire Empty App" project template. Then I added an out-of-the-box REACT application to that solution using the "React App" (javascript) project template. Then I added the "Aspire.Hosting.NodeJs" nuget package to the AspireApp1.AppHost project. Then I added this line to the Program.cs of the AspireApp1.AppHost project: builder.AddNpmApp("reactproject1", "../reactproject1", "dev").WithExternalHttpEndpoints(); When I build and run the solution I don't see any errors but I also don't see the endpoints.

Exceptions (if any)

This is the startup log for the REACT app, from the Aspire console logs window:

2025-01-27T16:50:29
2025-01-27T16:50:29 > [email protected] dev
2025-01-27T16:50:29 > vite
2025-01-27T16:50:29
2025-01-27T16:50:30
2025-01-27T16:50:30 VITE v6.0.11 ready in 252 ms
2025-01-27T16:50:30
2025-01-27T16:50:30 ➜ Local: http://localhost/:54358/
2025-01-27T16:50:30 ➜ Network: use --host to expose

.NET Version info

Microsoft Windows [Version 10.0.26100.2894]
(c) Microsoft Corporation. All rights reserved.

C:\Users\marti>dotnet --info
.NET SDK:
Version: 9.0.200-preview.0.24575.35
Commit: 81b5f040be
Workload version: 9.0.200-manifests.4a54b1a6
MSBuild version: 17.13.0-preview-24569-04+8f6b8ad0a

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.200-preview.0.24575.35\

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.1
Architecture: x64
Commit: c8acea2262

.NET SDKs installed:
8.0.303 [C:\Program Files\dotnet\sdk]
8.0.403 [C:\Program Files\dotnet\sdk]
9.0.101 [C:\Program Files\dotnet\sdk]
9.0.102 [C:\Program Files\dotnet\sdk]
9.0.200-preview.0.24575.35 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Anything else?

.NET SDK: 9.0.200-preview.0.24575.35
IDE: Visual Studio Version 17.12.4

Aspire.Hosting.AppHost: 9.0.0
Aspire.Hosting.NodeJs: 9.0.0

Microsoft.VisualStudio.JavaScript.Sdk/1.0.1738743

@joperezr joperezr added the untriaged New issue has not been triaged label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

2 participants