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

Dashboard 404 error - System.Text.Json breaks it #53

Open
rer145 opened this issue Jan 16, 2024 · 0 comments
Open

Dashboard 404 error - System.Text.Json breaks it #53

rer145 opened this issue Jan 16, 2024 · 0 comments

Comments

@rer145
Copy link

rer145 commented Jan 16, 2024

Framework: .NET 6.0
Coravel: v5.0.2
Coravel.Pro: v5.2.2
System.Text.Json: v8.0.0

While typing up this issue, I updated System.Text.Json to v8.0.1 and the dashboard now works. I'm still including the details below in case anyone else is having an issue or wants to research it more.

When trying to access the Coravel dashboard, I get a 404 error.

I've looked at some of the other posted issues and all the fixes are already present in my implementation. The dashboard was working perfectly up until recently, and I don't know what change has caused it to not work. Perhaps a package update?

While the dashboard doesn't work, a job that I scheduled via the dashboard is continuing to run properly. I just can't access the dashboard. Nothing is logged from Coravel.

I made extension methods for setting up Coravel and Coravel Pro as follows:

public static IServiceCollection ConfigureJobs(this IServiceCollection services)
{
    services.AddRazorPages().AddNewtonsoftJson();

    // register example jobs.
    services.AddTransient<Job1>();
    services.AddTransient<Job2>();

        // created a new dbcontext specifically for Coravel
	services.AddCoravelPro(typeof(CoravelDbContext));

	return services;
}

public static IApplicationBuilder UseJobs(this IApplicationBuilder app)
{
    app.ApplicationServices
        .ConfigureQueue();

    app.UseCoravelPro();

    return app;
}

In Program.cs I have the following (condensed):

var builder = WebApplication.CreateBuilder(args);
builder.Services.ConfigureJobs();

var app = builder.Build();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
	endpoints.MapRazorPages();
	endpoints.MapControllers();
});
app.UseJobs();

app.Run();
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