Skip to content

Doc best practices/expected usage for default vite app port #696

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

Open
maddymontaquila opened this issue May 23, 2025 · 0 comments
Open

Doc best practices/expected usage for default vite app port #696

maddymontaquila opened this issue May 23, 2025 · 0 comments

Comments

@maddymontaquila
Copy link
Contributor

Page URL

https://learn.microsoft.com/en-us/dotnet/aspire/community-toolkit/hosting-nodejs-extensions?tabs=dotnet-cli%2Cyarn#run-vite-apps

Describe the issue

Vite defaults their dev server to port 5173 (and then increments it if its taken) - when you follow the docs there is no guidance about setting targetPort or anything. The default endpoint handled by Aspire spins forever then fails because it doesn't point to 5173 (which works fine) -

Image
var frontend = builder.AddViteApp("frontend", "../frontend", packageManager: "pnpm")
    .WithPnpmPackageInstallation()
    .WithReference(ratingsApi)
    .WithExternalHttpEndpoints();

Suggestion

We should either handle that in the Vite extension by default or add
.WithHttpEndpoint(targetPort: 5173)
to the docs.

Additional context

No response

Help us help you

No, just wanted to report this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant