Hello!
I was following the blog article at: https://camunda.com/blog/2020/08/all-new-frontend-plugin-system-for-cockpit-starting-with-camunda-bpm-7-14/ to learn how to develop plugins for Camunda Cockpit.
In order to try out the plugin I followed the finished example on github, mentioned in the blogpost.
OS: MacOS Catalina
NPM version: 6.14.4
Container: camunda-bpm-tomcat-7.14.0-alpha2
git repo example name: cockpit-greetings-plugin
How to reproduce:
npm i
npm run build
from folder /dist/% cp plugin.js camunda-bpm-tomcat-7.14.0-alpha2/server/apache-tomcat-9.0.36/webapps/camunda/app/cockpit/scripts
I edited the config.js file in folder: camunda-bpm-tomcat-7.14.0-alpha2/server/apache-tomcat-9.0.36/webapps/camunda/app/cockpit/scripts
to contain:
export default {
customScripts: [
'/scripts/plugin.js'
]
}
then starting the server: ./start-camunda.sh
using firefox “inspect element”/developer tools, starting up the apache tomcat server, logging in with demo and navigating to cockpit gives the following error:
Errors from screenshot in text:
1. GET localhost:8080/camunda/app/scripts/config.js - [HTTP/1.1 404 7ms]
2. Loading module from “localhost:8080/camunda/app/scripts/config.js” was blocked because of a disallowed MIME type (“text/html”)
3. Uncaught (in promise) TypeError: error loading dynamically imported module
Full error message for GEThttp://localhost:8080/camunda/app/scripts/config.js
GEThttp://localhost:8080/camunda/app/scripts/config.js
[HTTP/1.1 404 7ms]
GET
http://localhost:8080/camunda/app/scripts/config.js
Status404
VersionHTTP/1.1
Transferred257 B (0 B size)
Connection
keep-alive
Content-Length
3940
Content-Security-Policy
base-uri 'self'
Content-Type
text/html
Date
Sun, 20 Sep 2020 19:21:48 GMT
Keep-Alive
timeout=20
X-Content-Type-Options
nosniff
X-XSS-Protection
1; mode=block
Accept
*/*
Accept-Encoding
gzip, deflate
Accept-Language
en-US,en;q=0.5
Connection
keep-alive
Cookie
JSESSIONID=1BE5BC22C867F9EABA2952F12996BEBA; XSRF-TOKEN=41A06E296FED840F5B9DCE27CF0C5648
Host
localhost:8080
Referer
http://localhost:8080/camunda/app/cockpit/default/
User-Agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0
Is there a setting/configuration of the server/plugin that I missed in the tutorial?
Would the http header: “X-Content-Type-Options” with value “nosniff” have to be changed for this to work or what am I missing?
Thanks in advance for any help on this matter,
Kind regards,
André