requirejs error loading js components

Bug #1372601 reported by Giovanny Andres Gongora Granada
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-touch-meta (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,

I am developing a Whatsapp client for Ubuntu Touch and I am using requirejs because is a webapp. I am seeing is an error with absolute paths. If the app runs on server there are not problems with absolute paths.

This is te repo with the app source:

https://github.com/ZydiaLabs/wahzap-ubuntu

This is the log that can be showed with the webkit (chrome) console:

Failed to load resource: Error opening /scripts/global.js: No such file or directory file:///scripts/global.js
Failed to load resource: Error opening /scripts/models/auth.js: No such file or directory file:///scripts/models/auth.js
Failed to load resource: Error opening /scripts/collections/contacts.js: No such file or directory file:///scripts/collections/contacts.js
Failed to load resource: Error opening /scripts/router.js: No such file or directory file:///scripts/router.js
Failed to load resource: Error opening /scripts/models/rtc.js: No such file or directory file:///scripts/models/rtc.js
Failed to load resource: Error opening /scripts/models/geoposition.js: No such file or directory file:///scripts/models/geoposition.js
Failed to load resource: Error opening /scripts/collections/history.js: No such file or directory file:///scripts/collections/history.js
Failed to load resource: Error opening /scripts/templates/helpers.js: No such file or directory file:///scripts/templates/helpers.js
Failed to load resource: Error opening /scripts/utils/notifications.js: No such file or directory file:///scripts/utils/notifications.js
Failed to load resource: Error opening /scripts/storage/dbmanager.js: No such file or directory file:///scripts/storage/dbmanager.js
Failed to load resource: Error opening /scripts/localisations/translation.js: No such file or directory file:///scripts/localisations/translation.js
Failed to load resource: Error opening /scripts/localisations/translation-utilities.js: No such file or directory file:///scripts/localisations/translation-utilities.js
Failed to load resource: Error opening /scripts/utils/language.js: No such file or directory file:///scripts/utils/language.js
Failed to load resource: Error opening /scripts/utils/sdmanager.js: No such file or directory file:///scripts/utils/sdmanager.js
Failed to load resource: Error opening /scripts/models/background-service.js: No such file or directory file:///scripts/models/background-service.js
Error: Script error for: global http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: models/auth http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: collections/contacts http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: router http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: models/rtc http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: models/geoposition http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: collections/history http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: templates/helpers http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: utils/notifications http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: storage/dbmanager http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: localisations/translation http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: localisations/translation-utilities http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: utils/language http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: utils/sdmanager http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Script error for: models/background-service http://requirejs.org/docs/errors.html#scripterror require.js:141
Failed to load resource: Error opening /components/underscore/underscore-min.js: No such file or directory file:///components/underscore/underscore-min.js
Error: Script error for: underscore http://requirejs.org/docs/errors.html#scripterror require.js:141
Failed to load resource: Error opening /components/zepto/zepto.min.js: No such file or directory file:///components/zepto/zepto.min.js
Error: Script error for: zeptojs http://requirejs.org/docs/errors.html#scripterror require.js:141
Error: Load timeout for modules: backbone http://requirejs.org/docs/errors.html#timeout

Revision history for this message
David Barth (dbarth) wrote :

You can't really make any assumption as to where your application will be installed, so you shouldn't use an absolute path when specifiying resources.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.