cancel
Showing results for 
Search instead for 
Did you mean: 

met a problem with tutorial code

Former Member
0 Kudos

Followed code is from tutorial step 3

OpenUI5 SDK - Demo Kit

<!DOCTYPE html>
<html>
  
<head>
  
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  
<meta charset="UTF-8">
  
<title>Walkthrough</title>
  
<script
  id
="sap-ui-bootstrap"
  src
="/resources/sap-ui-core.js"
  data
-sap-ui-theme="sap_bluecrystal"
  data
-sap-ui-libs="sap.m"
  data
-sap-ui-compatVersion="edge"
  data
-sap-ui-preload="async" >
  
</script>
  
<script>
  sap
.ui.getCore().attachInit(function () {
   new sap.m.Text({
  text
: "Hello World"
  
}).placeAt("content");

  
});
  
</script>
  
</head>
   <body class="sapUiBody" id="content">
  
</body>

</html>



Then I get some errors:

Uncaught Error: found in negative cache: 'sap/ui/core/Core.js' from undefined/sap/ui/core/Core.js: Error: found in negative cache: 'jquery.sap.events.js' from undefined/jquery.sap.events.js: Error: failed to load 'sap/ui/thirdparty/jquery-mobile-custom.js' from http://localhost:8080/resources/sap/ui/thirdparty/jquery-mobile-custom.js: 404 - Not Found

localhost/:16 Uncaught TypeError: sap.ui.getCore is not a function

I am sure that the path of src is correct coz I ran it sucessfully on another desktop, but after I copy the project to this desktop, it has the above problem. And then I re-download the UI5 runtime from SAP website and it works now.

But I am still curious about the reason of the problem.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Remove the first / in the path for the SAPUI5 Sources:

src="resources/sap-ui-core.js"

former_member182862
Active Contributor
0 Kudos

Hi Ming

I thought it should be

   <script
  id="sap-ui-bootstrap"
  src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js" 
  data-sap-ui-theme="sap_bluecrystal"
  data-sap-ui-libs="sap.m"
  data-sap-ui-compatVersion="edge"
  data-sap-ui-preload="async" >   </script>

-D

santhu_gowdaz
Active Contributor
0 Kudos

Please download "sap-ui-core.js" and give that path in src for offline.

else change src as below,

src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"

AmarUbhe
Advisor
Advisor
0 Kudos

Hello Ming  Yu,

If source file is available in path then please check that you have permission to access of that file.

these may cause of access permission also.