cancel
Showing results for 
Search instead for 
Did you mean: 

Uncaught ReferenceError: jQuery is not defined at sap-ui-core.js:144

former_member433064
Discoverer
0 Kudos

Hi,

I am trying to create a desktop application of SAPUI5 using Electronjs. I am facing an error while launching the application saying "Uncaught ReferenceError: jQuery is not defined at sap-ui-core.js:144" and "Uncaught TypeError: sap.ui.getCore is not a function at index.html:20".

Please let me know how I can resolve these errors.

Thanks,

Anmol

Accepted Solutions (0)

Answers (2)

Answers (2)

irfan_gokak
Contributor
0 Kudos

Hi,

Share your index.html code

former_member433064
Discoverer
0 Kudos

Please find below code from index.html

<!DOCTYPE html >
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>Shop Administration Tool</title>
<script
id="sap-ui-bootstrap"
src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_belize"
data-sap-ui-libs="sap.m, sap.tnt"
data-sap-ui-compatVersion="edge"
data-sap-ui-resourceroots='{"sap.ui.demo.toolpageapp": "./"}'
data-sap-ui-preload="async">
</script>
<script>
sap.ui.getCore().attachInit(function() {
sap.ui.require([
"sap/ui/core/ComponentContainer"
], function() {
new sap.ui.core.ComponentContainer({
name: "sap.ui.demo.toolpageapp"
}).placeAt("content");
});
});
</script>
</head>
<body id="content">
</body>
</html>

When I am running my project using ELECTRONJS to create a desktop app then it is giving me this error else it is working fine. Please let me know how I can resolve this.

irfan_gokak
Contributor
0 Kudos

Share your package.json and main.json file also

former_member484715
Contributor
0 Kudos

Hi Anmol Agarwal,

The error might be caused because your libraries are not getting rendered when your application is running in the browser. This happens when the SAPUI5 bootstrapping doesnot happen correctly. Could you check you index.html file for the scripts, especially where the bootstrapping takes place.Maybe you might have missed something there.

Regards.

former_member433064
Discoverer
0 Kudos

Please find below code from index.html

<!DOCTYPE html >
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>Shop Administration Tool</title>
<script
id="sap-ui-bootstrap"
src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_belize"
data-sap-ui-libs="sap.m, sap.tnt"
data-sap-ui-compatVersion="edge"
data-sap-ui-resourceroots='{"sap.ui.demo.toolpageapp": "./"}'
data-sap-ui-preload="async">
</script>
<script>
sap.ui.getCore().attachInit(function() {
sap.ui.require([
"sap/ui/core/ComponentContainer"
], function() {
new sap.ui.core.ComponentContainer({
name: "sap.ui.demo.toolpageapp"
}).placeAt("content");
});
});
</script>
</head>
<body id="content">
</body>
</html>

When I am running my project using ELECTRONJS to create a desktop app then it is giving me this error else it is working fine. Please let me know how I can resolve this.

former_member484715
Contributor
0 Kudos

Hi Anmol Agarwal,

I am not sure how it works with electronjs, with browser and UI perspective your code is fully correct and should be working in the browser perfectly. I think you have to configure the external libraries in the module before using them in elctronjs.

Regards.