cancel
Showing results for 
Search instead for 
Did you mean: 

sapui5 demo app (shopping cart) not working in local environment

Former Member
0 Kudos

I tried to have this demo app Shopping Cart working in my local eclipse environment, here's my eclipse project (Dropbox - cart.zip) with all the demo app source file in it, the only thing I changed was to change the sap-ui-core.js reference link, when I ran it, I got

Uncaught Error: failed to load 'sap/ui/demo/cart/Component.js' from ./Component.js: Error: failed to load 'sap/m/routing/Router.js' from resources/sap/m/routing/Router.js: 404 - Not Found

Could any one please kindly let me know if there's anything else I 'll need to change in order to make it to work? Thanks

Accepted Solutions (1)

Accepted Solutions (1)

kedarT
Active Contributor
0 Kudos

Hi Tylr,

You are missing Router.js file.

Also change the path in return UIComponent.extend("sap.ui.demo.cart.Component"

to UICompoent.extend("cart.cart.Component")

Hope this helps.

Former Member
0 Kudos

Hello Kedar, thank you so much for your reply.

I thought the Router.js is delivered by the framework (sap/m/routing/Router.js), I didn't find it in the demo application.

And after I changed UIComponent.extend from cart.cart.Component as you suggested, but still, I'm getting failed to load 'sap/ui/demo/cart/Component.js' from ./Component.js

joao_sousa2
Active Contributor
0 Kudos

How dix you create the project in Eclipse? You seem to have a problem with the setup of the resources. Can you see the Javascript libraries as a dependency in the project explorer? You should be able to navigate to the router class.

And what the version of your SAPUI5 in Eclipse?

Former Member
0 Kudos

Joao,

I basically created a new empty ui5 project in eclipse, and then copied everything into the WebContent folder, that's how I've been doing it, all my other projects are working just fine. My SAPUI5 version in eclipse is 1.24.0

joao_sousa2
Active Contributor
0 Kudos

The problem is the version of SAPUI5. Use the most recent 1.28 and the problem should go away. In your version that object didn't exist.

The API changes a lot in version 1, you need to make sure your example was built against a compatible version.

Former Member
0 Kudos

Thank you so much Joao, turned out the root cause was with my local SAPUI5 core library version, in the index.html file bootstrap, instead of using the local lib, I replaced it with  https://openui5.hana.ondemand.com/resources/sap-ui-core.js

everything works after that

Answers (0)