-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
7.14.0, 7.13.4, 7.12.10
-
None
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.
This is the controller panel for Smart Panels app
- is related to
-
CAM-12456 As a Plugin developer, I can create a Webapp Plugin without a Frontend
- Closed