cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Uncaught ReferenceError: sap is not defined.

0 Likes
8,476

Hi Experts,

I am new to SAP UI5/FIORI trying to learn to UI5.

I have written a simple HTML file to try on WEB IDE.

But when I run the file, I cannot display the button.

Error, when I see in browser developer mode in Chrome, shows this error,

Please let me know what is missing, that would be very helpful for me.

Regards,

Akhila.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

You might want to add "s" in source path. Look at the error "This request is blocked; the content must be served over HTTPS"

<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"><script>

This is the link from docs.

0 Likes

Hi Norbert,

I have added "https" and now am getting this below error.

Please help me to solve this.

Thanks,

Akhila.

Former Member
0 Likes

More specifically pls. You have got 3 more errors on the screen that u share. The second one should have disappear.

Try to start here, and use same script attributes:
https://sapui5.hana.ondemand.com/#/topic/851bde42e4e1410c96abbe402fa9128c

Former Member
0 Likes

There is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this 'x' is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the 'x'.

To solve this error: Load your library at the beginning of all your scripts.

There can be multiple other reasons for this issue:

  • Path to CDN library you included is not correct
  • The library file is corrupted
  • Working offline
  • Conflict with Other Libraries