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

TypeError: reduce of empty array with no initial value on https://changes.moz.tools/team.html?teams=Privacy+Engineering+-+WebCompat #4588

Open
marco-c opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working ui

Comments

@marco-c
Copy link
Collaborator

marco-c commented Nov 1, 2024

The error occurs on:

export async function renderTestFailureStatsChart(chartEl) {
  const componentsToDaysToStats = await componentTestStats;

  const components = getOption("components");

  const allTestStatsDays = [].concat
    .apply(
      [],
      Object.entries(componentsToDaysToStats)
        .filter(([component, daysToStats]) => components.includes(component))
        .map(([_, daysToStats]) => Object.entries(daysToStats))
    )
    .filter((testStatsDay) => "bugs" in testStatsDay[1]);

  const minDate = getPlainDate(
    allTestStatsDays.reduce((minTestStatsDay, testStatsDay) =>
      Temporal.PlainDate.compare(
        getPlainDate(testStatsDay[0]),
        getPlainDate(minTestStatsDay[0])
      ) < 0
        ? testStatsDay
        : minTestStatsDay
    )[0]
  );
@marco-c marco-c added the ui label Nov 1, 2024
@suhaibmujahid suhaibmujahid added the bug Something isn't working label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ui
Projects
None yet
Development

No branches or pull requests

2 participants