Skip to Content
0

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

Dec 01, 2017 at 01:19 PM

338

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Arjun Biswas Dec 02, 2017 at 04:25 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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.

0

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.

0
Irfan Gokak Dec 02, 2017 at 11:11 AM
0

Hi,

Share your index.html code

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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.

0

Share your package.json and main.json file also

0