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

Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Minor Minor
    • echarts-api-plugin
    • None

      I received the following stack trace in 2.404 after running a simple Pipeline job with no build history. The Pipeline job is the sample Maven project with tests and just runs a standard junit step to collect the test results.

      Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
          redraw http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:96:44
          renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:132
          genMethod/proxy[methodName]/</< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:52
          promise callback*genMethod/proxy[methodName]/< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:46
          promise callback*genMethod/proxy[methodName] http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:43
          renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:131
          renderConfigurableTrendChart http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:171
          <anonymous> http://127.0.0.1/job/pipeline/:131
      

      Setting a breakpoint, model is undefined, so JSON.parse can't parse it.

          [JENKINS-71230] Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

          Basil Crow created issue -
          Basil Crow made changes -
          Description Original: To reproduce this, upgrade to 2.404 or later, go to your user page, click on Configure, scroll to the Experiments section at the bottom, enable the "Remove Prototype.js" feature flag, and then visit the job page for a Pipeline project that has a test result trend. The following exception is logged in the console and the trend is not displayed:

          {noformat}
          Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
              redraw http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:96:44
              renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:132
              genMethod/proxy[methodName]/</< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:52
              promise callback*genMethod/proxy[methodName]/< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:46
              promise callback*genMethod/proxy[methodName] http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:43
              renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:131
              renderConfigurableTrendChart http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:171
              <anonymous> http://127.0.0.1/job/pipeline/:131
          {noformat}

          The code works when Prototype.js is enabled.
          New: To reproduce this, upgrade to 2.404 or later, go to your user page, click on Configure, scroll to the Experiments section at the bottom, enable the "Remove Prototype.js" feature flag, and then visit the job page for a Pipeline project that has a test result trend. The following exception is logged in the console and the trend is not displayed:

          {noformat}
          Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
              redraw http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:96:44
              renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:132
              genMethod/proxy[methodName]/</< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:52
              promise callback*genMethod/proxy[methodName]/< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:46
              promise callback*genMethod/proxy[methodName] http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:43
              renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:131
              renderConfigurableTrendChart http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:171
              <anonymous> http://127.0.0.1/job/pipeline/:131
          {noformat}
          Basil Crow made changes -
          Summary Original: echarts-api-plugin does not work when Prototype.js is disabled New: Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
          Basil Crow made changes -
          Description Original: To reproduce this, upgrade to 2.404 or later, go to your user page, click on Configure, scroll to the Experiments section at the bottom, enable the "Remove Prototype.js" feature flag, and then visit the job page for a Pipeline project that has a test result trend. The following exception is logged in the console and the trend is not displayed:

          {noformat}
          Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
              redraw http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:96:44
              renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:132
              genMethod/proxy[methodName]/</< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:52
              promise callback*genMethod/proxy[methodName]/< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:46
              promise callback*genMethod/proxy[methodName] http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:43
              renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:131
              renderConfigurableTrendChart http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:171
              <anonymous> http://127.0.0.1/job/pipeline/:131
          {noformat}
          New: I received the following stack trace in 2.404 after running a simple Pipeline job with no build history. The Pipeline job is the sample Maven project with tests and just runs a standard {{junit}} step to collect the test results.

          {noformat}
          Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
              redraw http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:96:44
              renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:132
              genMethod/proxy[methodName]/</< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:52
              promise callback*genMethod/proxy[methodName]/< http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:46
              promise callback*genMethod/proxy[methodName] http://127.0.0.1/adjuncts/33658b63/org/kohsuke/stapler/bind.js:43
              renderAsynchronously http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:131
              renderConfigurableTrendChart http://127.0.0.1/static/33658b63/plugin/echarts-api/js/trend-chart.js:171
              <anonymous> http://127.0.0.1/job/pipeline/:131
          {noformat}

          Setting a breakpoint, {{model}} is undefined, so {{JSON.parse}} can't parse it.
          Basil Crow made changes -
          Link New: This issue duplicates JENKINS-71236 [ JENKINS-71236 ]
          Basil Crow made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            drulli Ulli Hafner
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: