graphicore / ufoJS

Javascript API for the Unified Font Object
lib.ufojs.org
GNU General Public License v3.0
52 stars 10 forks source link

Issue faced while implementing the Glif Rendered -Sample App #67

Closed YashAgarwal closed 8 years ago

YashAgarwal commented 8 years ago

I tried setting up the sample app on my machine(Ubuntu 16.04) with npm (v 3.5.2) and using gulp-connect to make a local server. I get a blank screen in the browser(chrome) and the console shows the following error:-

GET http://localhost:8080/lib/bower_components/Atem-RequireJS-Config/nodeConfig.js req.load @ require.js:1895

context.load @ require.js:1639
Module.load @ require.js:820
Module.fetch @ require.js:810
Module.check @ require.js:840
Module.enable @ require.js:1143
context.enable @ require.js:1511
(anonymous function) @ require.js:1128
(anonymous function) @ require.js:132
each @ require.js:57
Module.enable @ require.js:1090
Module.init @ require.js:774
(anonymous function) @ require.js:1416

require.js:166 
Uncaught Error: Script error for: ../../lib/bower_components/Atem-RequireJS-Config/nodeConfig
http://requirejs.org/docs/errors.html#scripterror

FYI here is the copy of the error I get in Firefox

Error: Script error for: ../../lib/bower_components/Atem-RequireJS-Config/nodeConfig
http://requirejs.org/docs/errors.html#scripterror
 require.js:166:17
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead. localhost:8080

the files are present in the correct directories

davelab6 commented 8 years ago

(Looks like a problem in the 0.9.0 release, as only https://github.com/graphicore/ufoJS/commit/8ccd2311bd45c6c9afa81b0de1e9b6596c802f25 is new since then...)

graphicore commented 8 years ago

Thanks for reporting!

I recently made some updates to the library, but I think I did not reflect this very well in the examples and the documentation. I'm looking myself into it.

I can run the test suite from node js but not in the browser: node:

path/to/ufoJS$  npm test
[Test output]
------------------------------------------------------------
| TEST SUMMARY:
------------------------------------------------------------
     173 tests in 20 groups
     0 errors
     0 failures

in the browser:

path/to/ufoJS$ ./serve.sh

go to: http://localhost:8080/env/tests.html

fails with: NetworkError: 404 File not found - http://localhost:8080/path.js

Though the testsuite at gh-pages is running: http://lib.ufojs.org/env/tests.html

So yes, something got screwed up.

@YashAgarwal This does not yet touch your problem. But, this is the first thing I encountered.

The glif rendering example is working though, locally for me at http://localhost:8080/env/glif-renderer.xhtml

Undocumented at the moment:

You'll have to use bower to install further dependencies:

path/to/ufoJS$ bower install

you can install bower with npm or even with apt-get, though that version is rather not the latest.

graphicore commented 8 years ago

Use of getPreventDefault() is deprecated. Use defaultPrevented instead. localhost:8080

does it tell you in which file this happens?

the files are present in the correct directories

So your ufoJS/lib/bower_components looks already roughly like this?

ufoJS/lib/bower_components$ ls
Atem-CPS-whitelisting  Atem-Math-Tools        complex           obtainjs
Atem-Errors            Atem-Pen-Case          event-emitter.js  path
Atem-IO                Atem-RequireJS-Config  jszip
YashAgarwal commented 8 years ago

@graphicore Yes, it looks exactly like this

graphicore commented 8 years ago

are the tests from the console working for you, and can you access the test app via the server that is started with the serve.sh script?

graphicore commented 8 years ago

Ok, via a side channel we figured out that using gulp-connect is misbehaving, we don't know more details.

And I figured out that the browser test runner used the wrong config (6452d775) and that for the browser the requirejs-domReady dependency was missing (a4f9c8181).

@YashAgarwal can this be closed?

YashAgarwal commented 8 years ago

@graphicore sure, thanks for your help