Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64587

JavaScript error in history.js: Cannot read property 'getAttribute' of null

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: junit-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.263.1
      JUnit Plugin 1.48
      ECharts API Plugin 4.9.0-2
      Microsoft Edge Version 87.0.664.75 (Official build) (64-bit)
    • Similar Issues:

      Description

      At https://REDACTED/jenkins/job/REDACTED/job/master/327/testReport/history/, if I comment out the $('[data-toggle="tooltip"]').tooltip(); call that causes JENKINS-64585, then Microsoft Edge developer console shows the following:

      hudson-behavior.js:2982 Uncaught TypeError: Cannot read property 'getAttribute' of null
          at echarts-en.min.js:22
          at mf (echarts-en.min.js:22)
          at Object.t.init (echarts-en.min.js:22)
          at EChartsJenkinsApi.renderZoomableTrendChart (zoomable-trend-chart.js:12)
          at VM7234 history.js:24
          at onSuccess (bind.js:57)
          at klass.respondToReadyState (prototype.js:1657)
          at klass.onStateChange (prototype.js:1600)
          at XMLHttpRequest.<anonymous> (prototype.js:414)
      
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/85650739-3a10-44f4-8fe4-1ad440272e58/getTestDurationTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/85650739-3a10-44f4-8fe4-1ad440272e58/getTestResultTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/5d5f63a9-5ad4-43ae-b182-68bbc80c173b/getTestDurationTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/5d5f63a9-5ad4-43ae-b182-68bbc80c173b/getTestResultTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/4fd13dd3-907d-4c4d-b734-d832501f8b99/getTestDurationTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/4fd13dd3-907d-4c4d-b734-d832501f8b99/getTestResultTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/9e15d6ff-05fe-4133-b104-fe46bd4a937e/getTestResultTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/9e15d6ff-05fe-4133-b104-fe46bd4a937e/getTestDurationTrend".
      

      I suppose it means the DOM has not yet finished loading when EChartsJenkinsApi.renderZoomableTrendChart tries to find "test-duration-trend-chart" by ID.

      The error does not occur if I make the entirety of history.js wait for the DOM, like this:

      jQuery3(function ($) {
          ...
      });
      

      (This caught my eye while I was trying to find what causes JENKINS-64586.)

        Attachments

          Issue Links

            Activity

            Hide
            kon Kalle Niemitalo added a comment -

            The error does not occur if I make the entirety of history.js wait for the DOM, like this:

            jQuery3(function ($) {
                ...
            });
            

            Would that also need to capture view, like this?

            (function ($, view) {
                $(function () {
                    ...
                });
            })(jQuery3, view);
            
            Show
            kon Kalle Niemitalo added a comment - The error does not occur if I make the entirety of history.js wait for the DOM, like this: jQuery3( function ($) { ... }); Would that also need to capture view , like this? ( function ($, view) { $( function () { ... }); })(jQuery3, view);

              People

              Assignee:
              timja Tim Jacomb
              Reporter:
              kon Kalle Niemitalo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: