mrpmorris / Fluxor

Fluxor is a zero boilerplate Flux/Redux library for Microsoft .NET and Blazor.
MIT License
1.27k stars 147 forks source link

index.js not found on server side blazor dotnet core 6 #323

Closed soomon closed 2 years ago

soomon commented 2 years ago

hi,

I would like to reference this issue since it might be related: https://github.com/mrpmorris/Fluxor/issues/104

I got a blazor server app running on Dotnet Core 6.0.300. Packages installed are Fluxor, Fluxor.Blazor.Web and Fluxor.Blazor.Web.ReduxDevTools, all in version 5.4.0 .

when I open my application in Egde I get this error: GET https://localhost:44345/_content/Fluxor.Blazor.Web/scripts/index.js net::ERR_ABORTED 404 This happens on my development machine and in production. launch profile:

 "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }

I tried adding webBuilder.UseStaticWebAssets(); } to my program.cs:

 public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); webBuilder.UseStaticWebAssets(); });

    }

Here's my configure method frrom Startup.cs:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseMigrationsEndPoint();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
            {
                var databaseInitializer = serviceScope.ServiceProvider.GetService<IDatabaseInitializer>();
                databaseInitializer.SeedAsync().Wait();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseSession();
            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
                endpoints.MapBlazorHub();
                endpoints.MapFallbackToPage("/_Host");
            });

        }

But the issue is still the same. Could you please help me out here?

Thanks!!

mrpmorris commented 2 years ago

It no longer exists...

https://github.com/mrpmorris/Fluxor/releases/tag/5.0

soomon commented 2 years ago

Aaaaah I can simply remove the reference. Awesome thank you!!!