[Sugar-devel] text.js missing in Sugar Web Framework ?

Manuel Quiñones manuq at laptop.org
Tue Feb 11 17:05:40 EST 2014


Hi Lionel,

2014-02-11 18:27 GMT-03:00 Lionel Laské <lionel at olpc-france.org>:
> Hi all,
>
> I'm playing with the last version of Sugar Web Framework [1]
> At the top of the "sugar-web/graphics/activitypalette.js"  [2] file there
> is:
>
>        define(["sugar-web/graphics/palette",
>              "text!sugar-web/graphics/activitypalette.html"], function
> (palette, template) {
>
>         'use strict';
>
>          var activitypalette = {};
>
>
> The line "text!..." means that it use the "text" require.js plug-in [3].
> However, I don't see any trace of the "text.js" into the activity template
> [4].
> When I launch my activity, I've got this issue:
>
>     xo-74-2e-b8.localdomain - - [09/Feb/2014 14:28:05] "GET
> /lib/sugar-web/graphics/icon.js HTTP/1.1" 200 -
>     xo-74-2e-b8.localdomain - - [09/Feb/2014 14:28:05] "GET
> /lib/sugar-web/graphics/activitypalette.js HTTP/1.1" 200 -
>     xo-74-2e-b8.localdomain - - [09/Feb/2014 14:28:05] "GET
> /lib/sugar-web/graphics/palette.js HTTP/1.1" 200 -
>     1391956085.501851 ERROR root: file
> /home/olpc/Activities/TankOp.activity//lib/text.js not found.
>     xo-74-2e-b8.localdomain - - [09/Feb/2014 14:28:05] "GET /lib/text.js
> HTTP/1.1" 404 -
> ** Message: console message: http://0.0.0.0:50134/lib/require.js @1765:
> Error: Script error
>     http://requirejs.org/docs/errors.html#scripterror
>
>     ** Message: console message: http://0.0.0.0:50134/lib/require.js @1765:
> Error: Load timeout for modules:
> text!sugar-web/graphics/activitypalette.html_unnormalized2
>     http://requirejs.org/docs/errors.html#timeout
>
> After a bit of exploring I've understood that it's related to the miss of
> the text plug-in (text.js).
> When I copy this file in the lib directory, the activity works.
>
> Do I miss something ?
> Where the text.js file should come from ?
> It should not be into the activity template [4] ?

text.js is a dependency, so it should be listed in package.json, like
domReady.js is.  Then the volo command takes care of pulling deps.

But turns out text.js is not listed in package.json.  So it's a bug.

sugar-build must be putting it there in the development environment.

>
> Thanks for your help.
>
>                 Lionel.
>
>
> [1] https://github.com/sugarlabs/sugar-web
> [2]
> https://github.com/sugarlabs/sugar-web/blob/master/graphics/activitypalette.js#L1
> [3] https://github.com/requirejs/text
> [4] https://github.com/sugarlabs/sugar-web-template
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
.. manuq ..


More information about the Sugar-devel mailing list