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

ASP.NET 8 + ANGULAR Template with Docker breaks the SPA proxy #55614

Open
1 task done
Eugenenoble2005 opened this issue May 8, 2024 · 4 comments
Open
1 task done

ASP.NET 8 + ANGULAR Template with Docker breaks the SPA proxy #55614

Eugenenoble2005 opened this issue May 8, 2024 · 4 comments
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates

Comments

@Eugenenoble2005
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When an angular + asp.net 8 project is created with docker selected at the creation screen, all services are able to build and run however the spa proxy does not work because docker randomly reassigns the ports https port defined in the launchSettings.json. Is there a way around this?

Expected Behavior

SPA proxy should start and requests to the server applications should be forwarded to the client application (if they cannot be handled by the server).

Steps To Reproduce

Create a new project using the ASP.NET + Angular template. Enable docker support of the bat and select linux environment. Start the application, the weather forecast does not show in the angular app and there is an exception in the angular console making it clear the spa proxy has failed to start successfully because docker reassigns the ports

Exceptions (if any)

No response

.NET Version

8.0.204

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label May 8, 2024
@Andy-Leitzinger-FP
Copy link

Has this issue been resolved or is there a workaround?

@Eugenenoble2005
Copy link
Author

Has this issue been resolved or is there a workaround?

Only workaround I've discovered so far is to just update the proxy URL in the proxy.conf.js whenever it changes.

@Andy-Leitzinger-FP
Copy link

Andy-Leitzinger-FP commented May 24, 2024

Is it possible to force the generated debugging Docker image to have a fixed host port instead of the randomly generated one which keeps changing? Is there a Docker debugging deployment command/setting to fix the port number in Visual Studio 2022?

@VilleFTW
Copy link

We still encounter this issue after creating a fresh ASP.NET Core (8) + Angular SPA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

No branches or pull requests

3 participants