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

transformToJSX handles Path string wrong on windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Trivial
    • Resolution: Fixed
    • Component/s: js-builder
    • Labels:
      None
    • Similar Issues:

      Description

      When building blueocean on windows the build breaks with

      [INFO] [13:01:55] Browserify bundle processing error
      [INFO] [13:01:55] 	error: Error: Cannot find module '..srcmainjs/AdminNavLink.jsx' from 'C:\Develop\blueocean\blueocean-dashboard\target'
      [ERROR] 
      [ERROR] C:\Develop\blueocean\blueocean-dashboard\node_modules\@jenkins-cd\js-builder\index.js:555
      [ERROR]                         throw 'Browserify bundle processing error. See above for details.';
      

      the cause is the path writen to jenkins-js-extension.jsx the \ is not escaped correctly
      changing

      var relPath = path.relative(targetRoot, srcRoot);
      

      to

      var relPath = path.relative(targetRoot, srcRoot).split("\\").join("\\\\");
      

      solves the problem for me (in @jenkins-cd\subs\extensions-bundle.js)

        Attachments

          Activity

          Hide
          ianceicys Ian Ceicys added a comment - - edited

          So I attempted these steps and updated file (D:\GIT\blueocean-plugin\js-extensions@jenkins-cd\subs\extensions-bundle.js)
          var relPath = path.relative(targetRoot, srcRoot);
          to
          var relPath = path.relative(targetRoot, srcRoot).split("\\").join("\\\\");

          Now I am receiving a new error message:
          [INFO] [11:35:23] error: Error: Cannot find module '..srcmainjs/PipelineRoutes.jsx' from 'D:\GIT\blueocean-plugin\blueocean-dashboard\target'

          Here is a 2 minute video of my repo steps.
          https://www.youtube.com/watch?v=AkhTkTvuETQ?version=3&vq=hd1080

          I am still unable to build successfully on windows.

          Show
          ianceicys Ian Ceicys added a comment - - edited So I attempted these steps and updated file (D:\GIT\blueocean-plugin\js-extensions@jenkins-cd\subs\extensions-bundle.js) var relPath = path.relative(targetRoot, srcRoot); to var relPath = path.relative(targetRoot, srcRoot).split("\\").join("\\\\"); Now I am receiving a new error message: [INFO] [11:35:23] error: Error: Cannot find module '..srcmainjs/PipelineRoutes.jsx' from 'D:\GIT\blueocean-plugin\blueocean-dashboard\target' Here is a 2 minute video of my repo steps. https://www.youtube.com/watch?v=AkhTkTvuETQ?version=3&vq=hd1080 I am still unable to build successfully on windows.
          Hide
          tfennelly Tom FENNELLY added a comment -

          This particular issue is resolved not. Thanks for reporting.

          Show
          tfennelly Tom FENNELLY added a comment - This particular issue is resolved not. Thanks for reporting.

            People

            • Assignee:
              tfennelly Tom FENNELLY
              Reporter:
              thomas_kalmar Thomas Kalmár
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: