C
C#7mo ago
kacperz

I can't find ASP.NET Core with React.js

Hello guys, I want to create ASP.NET Core with React.js because I want to follow Tutorial but in visual studio on my computer I can't find it. Should I install additional module? May somebody help me with that?(the first screenshot is from tutorial)
No description
No description
35 Replies
leowest
leowest7mo ago
No description
leowest
leowest7mo ago
that's the only one I see I wonder if there is missing templates
kacperz
kacperzOP7mo ago
I have it too but are they the same? Why haven't I template from the tutorial is it because of visual studio version?
No description
leowest
leowest7mo ago
what version of visual studio are u using? I suspect they were replace but im not sure
kacperz
kacperzOP7mo ago
It's Visual Studio Community 2022 v17.10.0
No description
leowest
leowest7mo ago
]
No description
leowest
leowest7mo ago
yeah I guess they replaced it and the new template sets everything up
kacperz
kacperzOP7mo ago
ok thank you but I have another issue when I am trying to compile this application this errors occure everytime
No description
leowest
leowest7mo ago
and if u do it from the console?
kacperz
kacperzOP7mo ago
how can i do that?
leowest
leowest7mo ago
u go to the folder where the csproj is and do dotnet build
kacperz
kacperzOP7mo ago
No description
kacperz
kacperzOP7mo ago
it's the same issue
leowest
leowest7mo ago
open the vs installer
No description
leowest
leowest7mo ago
and go to modify and check nodejs
leowest
leowest7mo ago
No description
kacperz
kacperzOP7mo ago
i have it downloaded
No description
leowest
leowest7mo ago
then on the previous window do a repair on visual studio
kacperz
kacperzOP7mo ago
ok this may take a few minutes
leowest
leowest7mo ago
aside from that everything works for me
kacperz
kacperzOP7mo ago
I repaired this but it stil doesn't work
No description
leowest
leowest7mo ago
it would have helped if the errors were in English and not as a image, I dont do web front end so this is as far as I can help u sorry. Maybe someone else can assist u
kacperz
kacperzOP7mo ago
ok thank you
Keswiik
Keswiik7mo ago
What version of nodejs are you using?
friedice
friedice7mo ago
what version of .net do you have installed?
Jimmacle
Jimmacle7mo ago
.NET 8 doesn't have templates that include SPAs just set up the SPA separately
kacperz
kacperzOP7mo ago
No description
kacperz
kacperzOP7mo ago
.net 8.0 how can i do it?
Jimmacle
Jimmacle7mo ago
follow the instructions for setting one up with vite/etc vite can proxy requests to your API project in development and for production you can serve the frontend files directly from the API
Keswiik
Keswiik7mo ago
do you need vite? As long as you set up the SPA stuff properly in your Startup it should be able to run fine
Jimmacle
Jimmacle7mo ago
what SPA stuff are you referring to? i haven't done this much myself but vite does stuff like HMR for hot reloading when you change the frontend source
Keswiik
Keswiik7mo ago
app.UseSpa(spa => {
spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment()) {
spa.UseReactDevelopmentServer(npmScript: "start");
}
});
app.UseSpa(spa => {
spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment()) {
spa.UseReactDevelopmentServer(npmScript: "start");
}
});
Jimmacle
Jimmacle7mo ago
and what if you aren't using react :when:
Keswiik
Keswiik7mo ago
well this guy was trying to use react lol only reason I mentioned it
Jimmacle
Jimmacle7mo ago
i'm guessing that's specifically for CRA which to my understanding is hot garbage vite is a similar tool
Want results from more Discord servers?
Add your server