Uploaded image for project: 'Opencast'
  1. MH-12986

Admin-UI Source Maps are not mapping to source, unable to debug deployed admin-ui

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed and reviewed
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Labels:
      None
    • Severity:
      Operations
    • Steps to reproduce:
      Hide
      Steps to reproduce:

      1. Go to a 5.0 Opencst admin UI in any browser (i.e. https://stable.opencast.org)
      2. Open the developer tools for that browser, go to source/debugger area.
      3. Navigate to a src/main/webapp/scripts javascript in the Sources navigator (i.e. a mapped source)
       
       Actual Results: The source java is blank or returns login page HTML (see attached png "MissingMapSource")
       
       Expected Results: The source javascript is displayed and break points can be set in it for debugging. (See attached png "SourceMapMapsToSource")
       
       Workaround (if any): Modify the admin-ui/Gruntfile.js, replace uglify.options.sourceMap=true with uglify.options.sourceMap.includeSources=true, rebuild and redeploy the admin-ui jar.

           uglify: {
             options: {
      - sourceMap: true,
      + sourceMap: {
      + includeSources: true
      + },
       
      The solution makes the source maps very big 1-2MB. However, the source maps are only retrieved by the browser in debugging/developer mode, so the primary javascripts stay small for the normal client.

      A common scenerio for the need to debug in production is when an admin-UI issue that is not repeatable in a test environment and not exposed in the admin logs nor admin-ui console log.


      Show
      Steps to reproduce: 1. Go to a 5.0 Opencst admin UI in any browser (i.e. https://stable.opencast.org) 2. Open the developer tools for that browser, go to source/debugger area. 3. Navigate to a src/main/webapp/scripts javascript in the Sources navigator (i.e. a mapped source)    Actual Results: The source java is blank or returns login page HTML (see attached png "MissingMapSource")    Expected Results: The source javascript is displayed and break points can be set in it for debugging. (See attached png "SourceMapMapsToSource")    Workaround (if any): Modify the admin-ui/Gruntfile.js, replace uglify.options.sourceMap=true with uglify.options.sourceMap.includeSources=true, rebuild and redeploy the admin-ui jar.      uglify: {        options: { - sourceMap: true, + sourceMap: { + includeSources: true + },   The solution makes the source maps very big 1-2MB. However, the source maps are only retrieved by the browser in debugging/developer mode, so the primary javascripts stay small for the normal client. A common scenerio for the need to debug in production is when an admin-UI issue that is not repeatable in a test environment and not exposed in the admin logs nor admin-ui console log.

      TestRail: Results

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                karen_dolan Karen Dolan
                Reporter:
                karen_dolan Karen Dolan
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  TestRail: Cases