Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-12260

Plugin.css errors thrown in the browser console

    XMLWordPrintable

Details

    • Bug Report
    • Resolution: Fixed
    • L3 - Default
    • 7.14.0, 7.14.0-alpha4
    • 7.14.0, 7.13.4, 7.12.10
    • webapp
    • None

    Description

      Steps to reproduce

      Open Cockpit in Google Chrome and login

      Expected behavior

      No errors are shown in the developer console

      Observed behavior

      The following error is shown in the developer console:

      Refused to apply style from 'http://localhost:8080/camunda/api/cockpit/plugin/cockpitPlugins/static/app/plugin.css' because its MIME type ('application/json') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
      

      Root cause

      • With CAM-10019, we enabled mime type sniffing prevention
      • With 7.14, we stopped serving the styles via the backend plugin, i.e., the plugin.css files for both CE and EE are gone
      • When the static assets plugin endpoint cannot locate a resource, it returns an error 404 with a JSON object as the response body
      • The browser expects text/css, but the server returns application/json, which leads to the prevention of loading the file
      • The same behavior independently of the changes made in 7.14 applies if a custom plugin is registered which does not add a plugin.css file

      Solutions

      • Reintroduce empty plugin.css files to the CE and EE
      • Check in the frontend if the asset exists before adding the <link .../> tag to the DOM
      • Fix backend by returning an empty body with the "expected" content type for status code 404

      Solution #2 is probably the simplest and also effort-wise sensible.

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Issue Links

            Activity

              People

                michael.schoettes Michael Schoettes
                hariharan.parasuraman Hariharan Parasuraman
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Salesforce