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

nodejs-plugin breaks the blue ocean edit screen

      After adding a block to my Jenkinsfile:

       

      nodejs('Node 8.4.0') {
       sh 'node --version'
       sh 'npm --version'
       sh 'cd client && npm install'
       }

       

      And going to Blue Ocean and trying to edit the Jenkinsfile I get this error in the console:

      jenkins-js-extension.js:11662 Uncaught (in promise) Error: No parameters for: nodejs
       at convertStepFromJson (jenkins-js-extension.js:11662)
       at convertJsonToInternalModel (jenkins-js-extension.js:11621)
       at jenkins-js-extension.js:5905
       at jenkins-js-extension.js:11908
       at jenkins-js-extension.js:12426
       at <anonymous>

      and the page is mostly white but still has the blue toolbar on top.

          [JENKINS-46690] nodejs-plugin breaks the blue ocean edit screen

          Nikolas Falco added a comment -

          The nodejs command does not appear between available steps supported by BluOcean plugin.

          That I can see actually BluOcean support the following steps (Jenkins 2.60.3 and BluOcean 1.2.0):

          • Shell Script
          • Print Message
          • Enforce time limit
          • Retry the body up to N times
          • Sleep
          • Windows Batch Script
          • Archive the artifacts
          • Allocate node
          • Allocate workspace
          • Bind credentials to variables
          • Build a job
          • Catch error and set build result
          • Change current directory
          • Checks if running on a Unix-like node
          • Determine current directory
          • Error signal
          • Evaluate a Groovy source file into the Pipeline script
          • Expand a string containing macros
          • General Build Step
          • General Build Wrapper
          • General SCM
          • Git
          • JIRA: Add a comment to issue(s)
          • JIRA: Issue selector
          • JIRA: Search issues
          • Load a resource file from a shared library
          • Load a shared library on the fly
          • Mail
          • PowerShell Script
          • Publish HTML reports
          • Publish JUnit test result report
          • Read file from workspace
          • Read trusted file from SCM
          • Record fingerprints of files to track usage
          • Recursively delete the current directory from the workspace
          • Resolves an SCM from an SCM Source and a list of candidate target branch names
          • Restore files previously stashed
          • Run arbitrary Pipeline script
          • Set environment variables
          • Stash some files to be used later in the build
          • Subversion
          • The milestone step forces all builds to go through in order
          • Use a tool from a predefined Tool Installation
          • Validate a file containing a Declarative Pipeline
          • Verify if file exists in workspace
          • Wait for condition
          • Wait for interactive input
          • Write file to workspace

          If you want be sure that BlueOcean theme works with your job create the pipeline using wizard.

          Nikolas Falco added a comment - The nodejs command does not appear between available steps supported by BluOcean plugin. That I can see actually BluOcean support the following steps (Jenkins 2.60.3 and BluOcean 1.2.0): Shell Script Print Message Enforce time limit Retry the body up to N times Sleep Windows Batch Script Archive the artifacts Allocate node Allocate workspace Bind credentials to variables Build a job Catch error and set build result Change current directory Checks if running on a Unix-like node Determine current directory Error signal Evaluate a Groovy source file into the Pipeline script Expand a string containing macros General Build Step General Build Wrapper General SCM Git JIRA: Add a comment to issue(s) JIRA: Issue selector JIRA: Search issues Load a resource file from a shared library Load a shared library on the fly Mail PowerShell Script Publish HTML reports Publish JUnit test result report Read file from workspace Read trusted file from SCM Record fingerprints of files to track usage Recursively delete the current directory from the workspace Resolves an SCM from an SCM Source and a list of candidate target branch names Restore files previously stashed Run arbitrary Pipeline script Set environment variables Stash some files to be used later in the build Subversion The milestone step forces all builds to go through in order Use a tool from a predefined Tool Installation Validate a file containing a Declarative Pipeline Verify if file exists in workspace Wait for condition Wait for interactive input Write file to workspace If you want be sure that BlueOcean theme works with your job create the pipeline using wizard.

          Nikolas Falco added a comment - - edited

          A workaround is define nodejs as build wrapper step like the follow:

          pipeline {
            agent any
            stages {
              stage('build') {
                steps {
                  wrap([$class: 'NodeJSBuildWrapper', nodeJSInstallationName: 'Node 6.x' ]) {
                    sh 'npm --version'
                  }
                  
                  junit(testResults: '**/target/*.xml', allowEmptyResults: true)
                }
              }
            }
          }
          

          Nikolas Falco added a comment - - edited A workaround is define nodejs as build wrapper step like the follow: pipeline { agent any stages { stage( 'build' ) { steps { wrap([$class: 'NodeJSBuildWrapper' , nodeJSInstallationName: 'Node 6.x' ]) { sh 'npm --version' } junit(testResults: '**/target/*.xml' , allowEmptyResults: true ) } } } }

          Jake Wesorick added a comment -

          Gotcha. Thanks! Sorry for the false bug report.

          Jake Wesorick added a comment - Gotcha. Thanks! Sorry for the false bug report.

            nfalco Nikolas Falco
            jwesorick Jake Wesorick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: