Skip to content

MiniProfiler.ts: 'A table row was 5 columns wide, which is less than the column count established by the first row' #687

@rumplin

Description

@rumplin

In MiniProfiler.ts at const timingsTable = the column count in tfoot does not match the column count in thead.

Here is the code:

const timingsTable = `
        <table class="mp-timings">
          <thead>
            <tr>
              <th colspan="2"></th>
              <th>duration (ms)</th>
              <th class="mp-more-columns">with children (ms)</th>
              <th class="time-from-start mp-more-columns">from start (ms)</th>
              ${Object.keys(p.CustomTimingStats).map((k) => `<th title="call count">${encode(k)} (ms)</th>`).join('')}
            </tr>
          </thead>
          <tbody>
            ${renderTiming(p.Root)}
          </tbody>
          <tfoot>
            <tr>
              <td colspan="3"></td>
              <td class="mp-more-columns" colspan="2"></td>
            </tr>
          </tfoot>
        </table>`;

The problem lies in this line: ${Object.keys(p.CustomTimingStats).map((k) => ${encode(k)} (ms)).join('')}
Dynamically created table header columns.
In tfoot this is not accounted for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions