Reputation: 93
I have a SAP UI5 app deployed to BTP - Cloud Foundry env. The app was working fine, but suddenly I started getting the following error:
ModuleError: Failed to execute 'sap/suite/ui/commons/ChartContainer.js': Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src * data: blob:".
It is an overview page with some charts. I didn't change anything that could have caused the issue.
The issue is present even after updating the ui5 version to the latest "1.124.0".
I need to mention that I only get this error when open the app inside the SAP Build Work Zone.
When I open the same app in HTML5 Applications in the BTP Cockpit, the app opens fine.
I have also tried to clear the browser cache and also opening the app in the incognito mode, in case the cache is the issue, but that didn't help.
Here is the index.html - if that's relevant:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style>
html, body, body > div, #container, #container-uiarea {
height: 100%;
}
</style>
<script id="sap-ui-bootstrap"
src="https://ui5.sap.com/1.124.0/resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-resourceRoots='{
"test-reporting-app": "."
}'
data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-libs="sap.m"
>
</script>
</head>
<body id="content" class="sapUiBody sapUiSizeCompact">
<div data-sap-ui-component
data-name="test-reporting-app"
data-id="container"
data-settings='{ "id" : "test-reporting-app" }'
data-handle-validation="true"
></div>
</body>
</html>
Does anyone know what could have happened so that I have started getting this error?
Upvotes: 0
Views: 500