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

Script error when running the UI project #661

Closed
Imar opened this issue Oct 25, 2020 · 2 comments
Closed

Script error when running the UI project #661

Imar opened this issue Oct 25, 2020 · 2 comments
Labels

Comments

@Imar
Copy link

Imar commented Oct 25, 2020

I am trying to get HealthChecksUI to run, but encounter an exception in the browser. Here's what I did:

  1. Create new ASP.NET Core 3.1 app with MVC

  2. Install the following packages:

Install-Package AspNetCore.HealthChecks.UI
Install-Package AspNetCore.HealthChecks.UI.InMemory.Storage
Install-Package AspNetCore.HealthChecks.UI.Client

leading to these settings in the project file:

<PackageReference Include="AspNetCore.HealthChecks.UI" Version="3.1.3" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.1.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="3.1.2" />
  1. Configure Startup as follows:
  • ConfigureServices:
    services.AddHealthChecks();
    services.AddHealthChecksUI().AddInMemoryStorage();

  • Configure
    app.UseHealthChecks("/hc", new HealthCheckOptions()
    {
    Predicate = _ => true,
    ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
    });

    app.UseHealthChecksUI(setup =>
    {
      setup.ApiPath = "/hc";
      setup.UIPath = "/healthcheckui";
    });
    
  1. Browse to /healthcheckui

Expected results:

The Health Check UI shows up

Actual results:

I get a blank screen and the following error in the developer tools console:

vendors-dll.js:290 TypeError: e.map is not a function
at healthchecks-bundle.js:6
at t.LivenessTable (healthchecks-bundle.js:6)
at qi (vendors-dll.js:290)
at hs (vendors-dll.js:290)
at lu (vendors-dll.js:290)
at su (vendors-dll.js:290)
at Xs (vendors-dll.js:290)
at vendors-dll.js:290
at t.unstable_runWithPriority (vendors-dll.js:298)
at Ia (vendors-dll.js:290)
es @ vendors-dll.js:290
healthchecks-bundle.js:1 Uncaught TypeError: e.map is not a function
at healthchecks-bundle.js:6
at t.LivenessTable (healthchecks-bundle.js:6)
at qi (vendors-dll.js:290)
at hs (vendors-dll.js:290)
at lu (vendors-dll.js:290)
at su (vendors-dll.js:290)
at Xs (vendors-dll.js:290)
at vendors-dll.js:290
at t.unstable_runWithPriority (vendors-dll.js:298)
at Ia (vendors-dll.js:290)

I am running VS 2019 16.8 Preview 5, with the latest .NET 5 RC SDK although the app I am testing runs on .NET 3.1.

Any ideas would be greatly appreciated!

Imar

@Imar
Copy link
Author

Imar commented Oct 26, 2020

I can no longer reproduce this issue; it may have been related to a local IIS Express server having two web sites (one with the Health UI) pointing to the same SSL port so it may have been trying to pull the script files from the wrong server.

@Imar Imar closed this as completed Oct 26, 2020
@zorgoz
Copy link

zorgoz commented Jun 12, 2023

It is back in 7.0.0-rc2.7!

builder.Services.AddHealthChecks().AddDbContextCheck<NrgContext>();
builder.Services.AddHealthChecksUI().AddSqliteStorage("Data Source = healthchecks.db");
...
app.UseHealthChecks("/health", new HealthCheckOptions { ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse });
app.MapHealthChecksUI(o => { o.UseRelativeApiPath = true; o.ApiPath = "/health"; });

/health response:
{"status":"Healthy","totalDuration":"00:00:00.0695283","entries":{"NrgContext":{"data":{},"duration":"00:00:00.0270006","status":"Healthy","tags":[]}}}
(it is fetched by the UI)

90  TypeError: e.map is not a function
    at healthchecks-bundle.js:6:124398
    at t.LivenessTable (healthchecks-bundle.js:6:124567)
    at qi (vendors-dll.js:290:57929)
    at hs (vendors-dll.js:290:104168)
    at lu (vendors-dll.js:290:96716)
    at su (vendors-dll.js:290:96641)
    at Xs (vendors-dll.js:290:93671)
    at vendors-dll.js:290:45313
    at t.unstable_runWithPriority (vendors-dll.js:298:3844)
    at Ia (vendors-dll.js:290:45022)
es @ vendors-dll.js:290
healthchecks-bundle.js:1  Uncaught TypeError: e.map is not a function
    at healthchecks-bundle.js:6:124398
    at t.LivenessTable (healthchecks-bundle.js:6:124567)
    at qi (vendors-dll.js:290:57929)
    at hs (vendors-dll.js:290:104168)
    at lu (vendors-dll.js:290:96716)
    at su (vendors-dll.js:290:96641)
    at Xs (vendors-dll.js:290:93671)
    at vendors-dll.js:290:45313
    at t.unstable_runWithPriority (vendors-dll.js:298:3844)
    at Ia (vendors-dll.js:290:45022)

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

No branches or pull requests

3 participants